Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Random array MovieClip Disappears

New Here ,
Jun 09, 2014 Jun 09, 2014

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?

TOPICS
ActionScript
203
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2014 Jun 09, 2014

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 09, 2014 Jun 09, 2014

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 10, 2014 Jun 10, 2014
LATEST

and what's that code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines