Hi, I’m trying to create function that stacks movie clips on top of each other, but I think I’m having some trouble with the syntax.
I have a movieclip in the library with a linkage name of “mcClip” (I know, it was a bad idea to use this name more than once).
This is on a frame on the stage:
/////Beginning of Actionscript/////
nTotalClips = 3 //depending on how many I want to stack
newEvent();
/////Function code//////
function newEvent():Void {
for(i = 0; i < nTotalClips; i++){
sDummy = [“mcDummy” + i]
sClip = [“mcClip” + i]
sLast = [“mcDummy” + (i - 1)][“mcClip” + (i - 1)]
sCurrent = [“mcDummy” + i][“mcClip” + i]
trace(sCurrent)
this.createEmptyMovieClip(sDummy, this.getNextHighestDepth())
if(i == 0){
this.sDummy.createEmptyMovieClip(sClip, this.getNextHighestDepth())
this.sCurrent.attachMovie(“mcClip”, sClip, this.getNextHighestDepth())
} else {
this.sDummy.createEmptyMovieClip(sClip, this.getNextHighestDepth())
this.sCurrent.attachMovie(“mcClip”, sClip, this.getNextHighestDepth())
this.sCurrent._y = sLast._y + sLast._height
}
}
}
/////End of Actionscript/////
On the trace for sCurrent, the out returns “undefined” three times.
Thank you; I await your corrections/suggestions.