Ok, my title is very confusing.
I have a movie clip that is dropped onto my main scene, and I have the AS below as the frame’s AS.
The concept is simple: Create dynamic empty movieclips, position them, fill them, make them clickable. The code under “//////////////////////////////////////Code below here doesn’t work” isn’t working. The code worked fine when attempting to do this on my main scene, but I ran across some interface issues that caused me to put them into anorther MC. I understand that I only included the code for the first button, right now I would like to get at least one working.
for(var i=0; i<=43; i++){
iDepth = i + 200;
this["z_Brickmc_"+i] = this.createEmptyMovieClip("zBrick"+i+"_mc", iDepth);
}
xPos = 10;
yPos = 50;
cntr=1;
for(X=0;X<_global.BrickArray.length;X++){
eval("z_Brickmc_"+X)._x=xPos;
eval("z_Brickmc_"+X)._y=yPos;
xPos+=55;
if(cntr==11){
yPos+=55;
xPos = 10;
cntr=0;
}
cntr+=1;
}
for(X=0;X<_global.BrickArray.length;X++){
eval(this+".z_Brickmc_"+X).loadMovie(_global.BrickArray[X][1]);
}
//////////////////////////////////////Code below here doesn't work
var interval_0:Number;
this.z_Brickmc_0.onEnterFrame = function() {
if(this.z_Brickmc_0.getBytesLoaded() == this.z_Brickmc_0.getBytesTotal()) {
interval_0 = setInterval(this, "setButton_0", 100);
}
}
function setButton_0() {
this.z_Brickmc_0.onRelease = function() {
Loadz_Brick(0);
}
clearInterval(interval_0);
}