vendredi 3 mars 2017

I am not able to manipulate a Symbol that is nested within another Symbol

I'm a new coder and first time question asker. I'm working on a program that shows a math problem where each digit is represented by a Symbol. In order to make it easier to manipulate the size of the problem I want to make a Symbol "problem" and put the Symbols of "digit" inside it. "problem" is the name of the instance of Symbol "Problem" on the stage. The different digits are instances of the Symbol "Number" and are named like this "digit01, digit02, digit03, digit11..." up to "digit33" I want the program to cycle through all of the digits to make them stop at the first frame.

This is the relevant portion of my code:

for (var u: int = 0; u < 4;u++)
{
   for (var v: int = 1; v < 4;v++)
   {
       this["problem.digit" + u + v].gotoAndStop(1);
   }
}

When I run this I get Error #1069. "problem.digit01 not found on Main_Math and there is no default value."

Incidentally it works when I write the digits individually like this:

problem.digit01.gotoAndStop(1);
problem.digit02.gotoAndStop(2);

etc..

I appreciate any guidance you can offer. Thanks!

Aucun commentaire:

Enregistrer un commentaire