Skip to main content
Alex_95
Participating Frequently
June 10, 2014
Question

Random array MovieClip Disappears

  • June 10, 2014
  • 3 replies
  • 227 views

I'm using a Timer event function  to add random MovieClips from an Array, they base class makes them move from right to left.

var theArray:Array = new Array(mc1,mc2,mc3......)

function startIt (event:TimerEvent):void

{

       var theMovieClip =  new MovieClip();

      theMovieClip  = theArray[int(Math.random()*theArray.length)];

       theMovieClip .x = stage.stageWidth;

       addChild(theMovieClip );

}

but sometimes the Movie Clip disappears, so my question is why?

And another Question, how can I remove them once they leave the stage?

This topic has been closed for replies.

3 replies

kglad
Community Expert
Community Expert
June 10, 2014

what base class?  is there code in the base class?

Alex_95
Alex_95Author
Participating Frequently
June 10, 2014

Yes, they their base class makes the move to the left

kglad
Community Expert
Community Expert
June 10, 2014

and what's that code?