I’m trying to add a series ofTextFields on the stage from a subclass of the creatorclass.
This is my structure:
FLA, the .fla file
CRE, the creator file that’s connected to the FLA.
PROD, the sub class of CRE. I have made a instans of the PROD in the CRE file.
In the PROD file I’m creating a TextField and I want several of them to be placed on the stage.
This is the code:
var txt:TextField = new TextField();
txt.text = “Text”;
txt.x = 100;
txt.y = 100;
addChild(txt);
One TextField is no problem. The problem is when I need three och five or ten of them.
I never know how many I need so I’m creating them in a for-loop. It’s only the last one that’s being placed om the scene.
The outers is owerwritten.
Question:
How can I place all of them on the stage without creating them in the CRE class?
Cheers