all groups > flash actionscript > march 2004 >
You're in the

flash actionscript

group:

Movie Clip and multiple action scripts


Movie Clip and multiple action scripts ID. Awe
3/9/2004 10:35:38 PM
flash actionscript:
I have created a movie clip and assoicated an actionscript with it that creates
the MC many times and in a random fashion, this works as expected.

When I create another movie clip that is similar to the first (named
differently) and associate a similar actionscript with it (modified to relate
to new movie clip), the second movie clip only creates one version of itself,
while the first operates as it should.

If I reverse the layer order the opposite happens. How can you have FlashMX
execute both scripts fully?

moveMe = function () {
this._x += this.dx;
this._y += this.dy;
this.dx += 1;
this._alpha -= Math.random()* 2-10;
if (this._x>550) {
this.dx = Math.random()*20-10;
this.dy = Math.random()*5+10;
this._alpha = 100;
this._x = 0;
this._y = Math.random()*.5;
}
};
for (i=0; i<120; i++) {
nm = "bird" add i;
bird.duplicateMovieClip(nm, i);
_root[nm].dx = Math.random()*20-10;
_root[nm].dy = Math.random()*10-10;
_root[nm].onEnterFrame = moveMe;
_root[nm]._x = 0;
_root[nm]._y = Math.random()+2;
}
bird.onEnterFrame = moveMe;
Re: Movie Clip and multiple action scripts ID. Awe
3/10/2004 4:16:49 AM
AddThis Social Bookmark Button