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

How do you call the mc in the group of mc you just addchild?

New Here ,
Feb 23, 2014 Feb 23, 2014

var mcTxt:CText = new CText();

stage.addChild(mcTxt);

mcTxt.x = 640;

mcTxt.y = 40;

mcTxt.txtScore.text = 'Score:  ' + score;

          mcTxt.txtCombo.text = 'Combo:  ' + combo;

          mcTxt.txtScoreString.text = scoreString;

-----------------------------Explanation---------------

mcTxt got 3 mc-texts inside named txtScore,txtCombo and txtScoreString. The mcTxt shows on screnn perfectly.

Butthey don't show the scores up. I think because I code it wrong. How is the right way to call the mc inside the mc?

TOPICS
ActionScript
510
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 , Feb 23, 2014 Feb 23, 2014

There is nothing wrong with how you target the textfields inside the CText instance - if there were you would be getting error messages.  There might be a problem with how you have the textfield defined.  Check to make sure the text color is not the same as the background it sits over.  You might need to embed the font for the textfields, especially so if they are in any way tilted or moving or masked.

Translate
LEGEND ,
Feb 23, 2014 Feb 23, 2014

There is nothing wrong with how you target the textfields inside the CText instance - if there were you would be getting error messages.  There might be a problem with how you have the textfield defined.  Check to make sure the text color is not the same as the background it sits over.  You might need to embed the font for the textfields, especially so if they are in any way tilted or moving or masked.

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
New Here ,
Feb 23, 2014 Feb 23, 2014
LATEST

Thanks Ned Murphy. I actully found the problem yesterday and about to delete this topic before seeing you answer me back. It's like what you say the text code are correct, but the code calling vdos to stage was the problem. it made the variable missing.

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