Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The terms on http://www.dnai.org/glossary/ aren't showing definitions when clicked #5579

Closed
danielhjacobs opened this issue Nov 1, 2021 · 2 comments
Labels
A-avm1 Area: AVM1 (ActionScript 1 & 2) bug Something isn't working

Comments

@danielhjacobs
Copy link
Contributor

danielhjacobs commented Nov 1, 2021

Describe the bug

When clicking any term, you see the word "hi". For ease of accessing the link, I will rewrite the website from the issue title: http://www.dnai.org/glossary/

Expected behavior

e.g.: You are supposed to see the definition "One of the four bases that make up DNA. Abbreviated with an 'A.'" when clicking "Adenine".

Affected platform

Self-hosted version

Operating system

Linux Fedora 34 (64-bit)

Browser

Mozilla Firefox 93

Additional information

Despite the "Affected Platform" being "Self-hosted version" and the self-hosted version being somewhat out-of-date, I did try the latest extension as well (ensuring it took priority), and the same issue is still present.

Looking at the source code of http://www.dnai.org/glossary/glossary.swf in JPEXS, I see heavy use of _root, _parent, and _global. Possibly #768, or something related to iterating over "this"?

In DefineSprite (48: glossaryMC): frame1: DoAction (path based on JPEXS tags):

a = new Object();
a.Adenine = "One of the four bases that make up DNA.  Abbreviated with an \'A.\'";
a.Allele = "An alternate version of a gene, e.g., Gregor Mendel\'s pea plants have flowers with two colors: white and reddish-purple.  The flower color gene in this case has two alleles, one for white and the other for reddish-purple.";
a["Amino acids"] = "A class of molecules that are the building blocks of proteins.  There are 20 different amino acids used to make up proteins.";
...
z = new Object();
z.Zygote = "Refers to the cell formed by the union of two gametes; more broadly, refers to the organism that develops from such a cell.";
_global.glossary = new Object();
_global.temp = new Object();
for(aa in this)
{
   _global.temp[aa] = this[aa];
   _global.glossary[aa] = new Object();
   for(ab in _global.temp[aa])
   {
      _global.glossary[aa][ab] = _global.temp[aa][ab];
   }
   delete this.aa;
}
delete _global.temp;
@danielhjacobs danielhjacobs added the bug Something isn't working label Nov 1, 2021
@Toad06
Copy link
Member

Toad06 commented Nov 2, 2021

I've added some trace() in the code you mentioned and everything looks ok, all the variables are set correctly.

I rather think the issue is in \DefineSprite (42: bigDescriptionMC)\frame 1\DoAction. A few observations:

  • If you replace this["descriptionMC" + ctr].label with this["descriptionMC" + ctr].fake for instance, you will get "hi" in Flash too which makes sense since label is the variable name used in \texts\DefineEditText(15).

  • If you add trace(this["descriptionMC" + ctr].label); after this["descriptionMC" + ctr].label = ..., you get the same (and expected) values in Flash and Ruffle. If you add it before this line, Flash traces "hi" (the default value) but Ruffle traces "undefined".

This sounds similar to #2181 (also possibly to #4088).

@danielhjacobs
Copy link
Contributor Author

Fixed by #12541

@Lord-McSweeney Lord-McSweeney added the A-avm1 Area: AVM1 (ActionScript 1 & 2) label Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm1 Area: AVM1 (ActionScript 1 & 2) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants