Problem is this does’nt seem to work in a mc with a mask… it works i know that cos if i unmask my layer it starts perfectly but as soon as i make the layer mask again it stops working…
how come and how do i fix this?
Ps, and wile your at it… how do i add a random width section to this script?
Use setMask.
Make your mask a mc an give it the instancename “mask”.
Place it where you want it and put the code below
(btw the random width is also in it)
[AS]for (i=0; i<30; i++) {
mask._visible = 0;
mask_mc._visible = 0;
newBall = mask_mc.duplicateMovieClip(“mask_mc”+i, i);
newMask = mask.duplicateMovieClip(“mask”+i, 40+i);
newBall._x = Math.random()*600;
newBall._width = Math.random()*100;//randomly setting width
newBall.setMask(newMask);//masking
newBall.targX = Math.random()*600;
newBall.i = 0;
newBall.rand = Math.random()*50;
newBall.onEnterFrame = function() {
this.i++;
if (this.i>this.rand) {
this.targX = Math.random()*600;
this.i = 0;
this.rand = Math.random()*50;
}
this._x -= (this._x-this.targX)/5;
};
[/AS]
Hope I’ve understood you right this time.
The actions are now on a mc in the mc in the mask layer.
In case you don’t get me anymore, I made a little fla:)