hi all hoping someone can help me out, i’m adding a number of library movie clips to my stage using an external as file.
The names of the library clips are stored in an array like so:
public var spriteArray:Array = new Array("_one","_in","_seven")
for (var i:Number = 0; i<spriteArray.length; i++) {
mcName = spriteArray*;
mcClass = getDefinitionByName(mcName) as Class;
mcInst = new mcClass() as MovieClip;
mcInst.name = spriteArray*
namesArray.push(mcInst)
addChild(mcInst);
mcInst.scaleX = clipScale;
}
}
this is all cool and i can modify the scaleX from inside the for loop but i will be needing another function that loops over all the clips on the stage and applies an alpha fade for example.
how can i access the clips? where have they actually been added, this doesn’t throw any errors but doesn’t seem to do anything
public function anotherFunction():void {
for (var i:Number = 0; i<spriteArray.length; i++) {
namesArray*.alpha = 0;
}
}
i was hoping that using mcInst.name = spriteArray* / namesArray.push(mcInst) would work. Do i need to push the names in as a type, movieClip or something so i can later reference them from other functions? obviously missing something critical here ay!
any help would be appreciated.