Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Get variable inside MC FROM mine stage.

Explorer ,
Nov 09, 2016 Nov 09, 2016

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;

TOPICS
ActionScript
502
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 10, 2016 Nov 10, 2016

Try putting this code in the second frame of the main timeline where you have MC1...

       MC1.1teamName.text = teamName1_var;

Translate
LEGEND ,
Nov 09, 2016 Nov 09, 2016

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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 09, 2016 Nov 09, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 09, 2016 Nov 09, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 09, 2016 Nov 09, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2016 Nov 10, 2016

Try putting this code in the second frame of the main timeline where you have MC1...

       MC1.1teamName.text = teamName1_var;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 10, 2016 Nov 10, 2016

Maby i have problem becouse that this text field is animated in 3D?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2016 Nov 10, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 10, 2016 Nov 10, 2016

Oh I allways embeding fonts but this time i forgot... I look dificulties on the simple things thanks a lot for yout time.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2016 Nov 10, 2016
LATEST

You're welcome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines