Copy link to clipboard
Copied
Im trying to get variable inside movieclip from mine stage but i cant get it. I have error:
1120: Access of undefined property teamName1_var.
This is my code:
trace(String(teamName1_var));
tName1.text = teamName1_var;
Try putting this code in the second frame of the main timeline where you have MC1...
MC1.1teamName.text = teamName1_var;
Copy link to clipboard
Copied
To get the value of the variable that is inside a movieclip, you need to use the movieclip instance name along with the variable name.
trace(movieclipName.variableName);
Copy link to clipboard
Copied
Im inside MC1 and I need variable from main stage.
In the first frame of movie MC1 I have to write:
trace(MC1.teamName1_var);
1teamname.text = teamName1_var;
I have the same error..
How I undertsad now im looking variable teamName1_var in the movie clip MC1. But my variable is in main stage and in the CM1 I want to get that variable.
Copy link to clipboard
Copied
Your explanation is very confusing... "im looking variable teamName1_var in the movie clip MC1. But my variable is in main stage and in the CM1 I want to get that variable"
If you are in MC1 and you want to get the value of a variable named teamName1_var in the main timeline then the code inside MC1 to target the variable could be...
MovieClip(root).teamName1_var
If you are in MC1 and you want a variable named teamName1_var inside CM1, then...
MovieClip(root).CM1.teamName1_var
If none of those is what you want then you need to work on explaining it better.
Copy link to clipboard
Copied
Thank you for you help. my english is not good but im trying.
In the first frame of scene 1 I have variable teamName1_var this is a string.
In the second frame I have movieclip MC1.
Inside MC1 I have dynamic textfield instance name 1teamName.
In this dynamic text field 1teamName I want to get teamName1_var.
If I write code in scene1 frame1 I have the same error becouse there is no any variables inside movie clip MC1. Variable is in the first frame of scene1. inside movie clip MC1 frame 1 i want to write code for variable from scene1. :) its crazzy becouse i dont know how to explain it in other way.
Copy link to clipboard
Copied
Try putting this code in the second frame of the main timeline where you have MC1...
MC1.1teamName.text = teamName1_var;
Copy link to clipboard
Copied
Maby i have problem becouse that this text field is animated in 3D?
Copy link to clipboard
Copied
Yes... what you will need to do is embed the font in the textfield. Otherwise the text will not show up. Anytime you animate or even just change the rotation property of a textfield you need to embed the font. To embed the font just select the textfield and in the Properties Panel choose the option to embed the font.
Copy link to clipboard
Copied
Oh I allways embeding fonts but this time i forgot... I look dificulties on the simple things thanks a lot for yout time.
Copy link to clipboard
Copied
You're welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now