HI
I have a MC that I add to the stage multiple times using addChild. My adding code is:
function executeAddChild():void {
for (var j:int = 0; j < picturesList.length; j++) {
var MC:MovieClip = new box();
scrolly.contenty.addChild(MC);
MC.name="mc"+j;
MC.instanceName="mc"+j;
trace(MC.instanceName+" INSTANCEname");
MC.y=MC.height*j+MC.y;
MC.imageName.text=picturesList[j].substr(picturesList[j].indexOf("jpg")-9,12);
MC.quantity.text=quantityList[j];
MC.invisibleNumber.text = j+1;
}
}
executeAddChild();
until here I am happy.
The problem is that inside the each MC I have a number, inside a textBox (quantity.text). I need to access that number but I don’t know how! I want to update an array with the new quantity values inside each MC and then REMOVE the ZERO VALUES… and so on… I don’t know how to explain my app. All I need to know is how to access the value inside the MC added using addChild.
I’ve tryed like this:
function clearAddChild(e:Event):void {
trace("numChildren"+scrolly.contenty.numChildren);
trace("UPDATE AND REMOVE");
for (var i:int = 0; i < scrolly.contenty.numChildren+i; i++) {
trace("START ---------- i: "+i);
trace("quantity: "+scrolly.contenty.getChildAt*.quantity.text); //here is the error
scrolly.contenty.removeChildAt(0);
trace("END ------------ i: "+i);
}
executeAddChild();
}
actualizar.addEventListener(MouseEvent.CLICK, clearAddChild);
It is giving me the following error:
ReferenceError: Error #1069: Property 2 not found on builtin.as$0.MethodClosure and there is no default value.
at efwf_fla::MainTimeline/clearAddChild()
what should I do?
Thanks