Copy link to clipboard
Copied
I just want to use multiple attached movie clip as array, btw this is the simple code :
if(_global.plevel == 0)
{
var box1:MovieClip = _root.attachMovie("flip_box_lg", "fb1", this.getDepth()+5,{_x:100,_y:100});
box1._width = 100;
box1._height = 40;
box1._x = 60;
box1._y = 80;
var box2:MovieClip = _root.attachMovie("flip_box_lg", "fb2", this.getDepth()+6,{_x:100,_y:100});
box2._width = 100;
box2._height = 40;
box2._x = 170;
box2._y = 80;
this.onEnterFrame=assignF;
}
can I just making it like this ?
for(var i=0;i<6;i++)
{
var box:MovieClip = _root.attachMovie("flip_box_lg", "fb"+(i+1), this.getDepth()+5,{_x:60+(i*110),_y:80});
}
Thank you before
1 Correct answer
use:
var box:Array=[];
for(var i=0;i<6;i++)
{
box.push( _root.attachMovie("flip_box_lg", "fb"+(i+1), _root.getNextHighestDepth(),{_x:60+(i*110),_y:80}));
}
Copy link to clipboard
Copied
use:
var box:Array=[];
for(var i=0;i<6;i++)
{
box.push( _root.attachMovie("flip_box_lg", "fb"+(i+1), _root.getNextHighestDepth(),{_x:60+(i*110),_y:80}));
}
Copy link to clipboard
Copied
Thank you so much before, it works perfectly, but how to do onRelease with that movie clip array ?
box.onRelease = function () {
if(_global.menushow == 0)
{
this.play();
}
}
Copy link to clipboard
Copied
eh, already done by using
for(var i=0;i<4;i++)
{
box.onRelease = function () {
if(_global.menushow == 0)
{
this.play();
}
is that already right or have another more effiicient one ?
Thanks before
Copy link to clipboard
Copied
that's correct.
Copy link to clipboard
Copied
Thank you very much
Copy link to clipboard
Copied
you're welcome.

