Skip to main content
Known Participant
February 23, 2014
Answered

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

  • February 23, 2014
  • 1 reply
  • 540 views

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?

This topic has been closed for replies.
Correct answer Ned Murphy

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.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
February 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.

Known Participant
February 24, 2014

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.