Copy link to clipboard
Copied
On a frame I have 5 Dynamic Text objects:
On that frame I am directing variables to populate these objects:
this.sctn_HDR.text = sctn_AA2A;
this.AA2_Copy.text = AA2_copy;
this.PC1.text = AA2_PC1;
this.PC2.text = AA2_PC2;
this.PC3.text = AA2_PC3;
These are the varible strings:
sctn_AA2A = "SciLog Cryobag Filler System";
AA2_copy = "The SciLog Cryobag Filler...";
AA2_PC1 = "Single Use Sensors & Monitors";
AA2_PC2 = "Single Use Assemblies";
AA2_PC3 = "Bioprocess Containers";
So, what's the deal with this misplacement of the variables I assigned?
Why is Animate making my variables appear where I did not indicate?
Why, for example, is PC3 not displaying the string I assigned to it?
Advanced layers on or off makes no difference.
Anyone else running into this issue?
Thanks.
all those dynamic textfields were in a problematic layer. why it is problematic, i don't know. it may have been a guide layer previously or a camera layer or hidden or something else. or maybe that keyframe was the problem. it could have been part of a tween or something else.
i didn't search the fla history trying to figuire it out.
anyway, i moved those 5 or so textfields to the layer above. i changed nothing else. i group selected them, cut and pasted in place after creating a blank
...Copy link to clipboard
Copied
use console.log to debug
Copy link to clipboard
Copied
Thanks, I have and it makes no sense.
Uncaught TypeError: Cannot set properties of undefined (setting 'text')
this.PC2.text = AA2_PC2;
PC2 does exist and so does the variable. Nothing about the console log is helpful.
I tested this in Animate 2205 with the same results.
What on Earth could be the issue?
Thanks again.
Copy link to clipboard
Copied
If the console log error made sense, why is the variable I assigned to sctn_HDR showing up in PC2 if 'text' is undefined for PC2?
Copy link to clipboard
Copied
Hi.
Have you double-checked in the Properties panel if the instances names are assigned as you expected? Or maybe if you have other hidden/forgotten instances with the same name?
Please let us know.
Regards,
JC
Copy link to clipboard
Copied
The properties are correct, I always place the instance name in the field as a placeholder for clarity.
What could possibly cause variables I assigned to appear where I didn't assign them? It's crazy.
Thanks.
Copy link to clipboard
Copied
do the dynamic textfields exist (even if differently named) on any frame prior to the frame with code?
Copy link to clipboard
Copied
The objects AA2_Copy, PC1, 2 and 3 are unique to this frame.
sctn_HDR appears on other frames and is populated correctly.
Why would adding new DynText objects to a frame cause variables to be assigned where they don't belong?
Thanks.
Copy link to clipboard
Copied
delete the problematic textfields, and then recreate and name them.
Copy link to clipboard
Copied
Did that, no dice, I even changed the font to _sans in case embedding was an issue.
This can't just be happening to me, no one else has run into this?
Thanks.
Copy link to clipboard
Copied
PC2 doesn't exist on the frame that contains the code.
Copy link to clipboard
Copied
It certainly does exist, all the Dynamic text fields are on the same frame that contains the code.
The whole thing doesn't make sense... this is simple javascript. It should work.
Thanks.
Copy link to clipboard
Copied
above your code put:
console.log(this.PC1);
console.log(this.PC2XX);
Copy link to clipboard
Copied
Thanks,
console.log(this.PC1); produced quit a bit of info.
console.log(this.PC2); produced "undefined"
Copy link to clipboard
Copied
comment out
this.PC2.text = AA2_PC2;
and retest with those console.log's
Copy link to clipboard
Copied
console.log(this.PC2); still results undefined, an the issue cascaded to the next text field... its maddening.
Thanks!
Copy link to clipboard
Copied
working...
Copy link to clipboard
Copied
I really appreciate your expertise, thank you.
Copy link to clipboard
Copied
check private message for corrected fla
Copy link to clipboard
Copied
How did you do it? What did I miss? Yoou're a miracle worker!
Copy link to clipboard
Copied
all those dynamic textfields were in a problematic layer. why it is problematic, i don't know. it may have been a guide layer previously or a camera layer or hidden or something else. or maybe that keyframe was the problem. it could have been part of a tween or something else.
i didn't search the fla history trying to figuire it out.
anyway, i moved those 5 or so textfields to the layer above. i changed nothing else. i group selected them, cut and pasted in place after creating a blank keyframe in the above layer.
Copy link to clipboard
Copied
Is it that the text fields have to be in the layer above the scripting? So they load first?
I don't understand why then the other frames have no problem loading the variables into the text... I really appreciate your help on this. Thank you so much!
Copy link to clipboard
Copied
no, they do not need to be in an above layer. the assets are loaded on any particular keyframe and then the code executes.
Copy link to clipboard
Copied
In this frame I changed the variable name of sctn_HDR to sctn_HDRX to test.
Now the header populates... but PC2 and PC3 don't populate... how does this make sense?
Console log is no help again... TypeError: Cannot set properties of undefined (setting 'text')
Again, AA2_PC2 does exist.
Changing PC2 to PC2X = the same result...
Pretty baffling...
Copy link to clipboard
Copied
I deleted the text field and commented out it's line, and now the previous text field is an issue... it's like a reverse cascade error...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now