Copy link to clipboard
Copied
I'm want to tile a 700 x 700 area using attachMovie().
The movieclips used for the attachMovie is 50 x 50
This is the code. Something is wrong here.
var NuX:Number=0;
var NuY:Number=0;
var btnX:Array=[gpat_btn0, gpat_btn1, gpat_btn2];
var attX:Array=["pat0","pat1","pat2"];
for(i=0;i<btnX.length;i++){
btnX.pvar=i;
btnX.onRelease = function(){
NuX=NuY=0;
for(j=0;j<14;j++){
if(NuX>=650){
NuX=0;
NuY=NuY+50;
}
_root.movieC1.movieC2.clip0.attachMovie(attX[this.pvar], attX[this.pvar]+j, _root.movieC1.movieC2.getNextHighestDepth(), {_x:NuX, _y:NuY});
NuX=NuX+50;
//trace(NuX)
}
}
}
Copy link to clipboard
Copied
you're going to need 296 tiles and you're only creating 14. extend the for-loop.
Copy link to clipboard
Copied
Thanks.
But my problem is that the code is not working at all? There might be some error in the code? I have doubts with this particular line?
_root.movieC1.movieC2.clip0.attachMovie(attX[this.pvar], attX[this.pvar]+j, _root.movieC1.movieC2.getNextHighestDepth(), {_x:NuX, _y:NuY});
Copy link to clipboard
Copied
use trace(attX[this.pvar]) to see if a linkage id is being traced.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now