9 Replies Latest reply on Jun 21, 2006 8:30 PM by kglad

    [FlashMX 2004] Problem with  an animations random play

    Orkin
      Hello,

      firstable, I would like to thanks all the peoples that make this forum so interesting.

      I found a lot of informations on this site to help me to create my swf that i am working on.

      But , at this time I have a problem that i would like to expose to all of you


      My swf is quiet simple. I would like show different animations in a random way, with a skeletal
      timing. The list of the animations are included in the library of the principal animation.


      So I have this principal animation with, on the first frame this code:

      _global.MyTime = 5000

      //to create a random number between x and y
      //Math.round(Math.random()*(y-x))+x;
      // so to create a random number between 2 et 7 we will have:
      var MaVariable = Math.round(Math.random()*5)+2

      trace (MaVariable);
      gotoAndPlay(MaVariable);

      on the next frames 2 to 7 , I have inserted on each frame one library's animation with a stop().

      inside each library's animation , on the first frame, I have the following code:

      function GoGet() {
      _level0.gotoAndPlay(1);
      }
      clearInterval(SlideInt);
      SlideInt = setInterval(GoGet,MyTime);

      on the last frame I have a stop()



      So my problem is :

      in the beginning everything work fine, but after one minute, before to start the choose librairy's animation, it try to start 2 or 3 other librairy's animations. so in the beginning it's very cautious it just try to start one animation before the one choose, but after 2 minutes it try to start maybee 3 or 4 librairy's animations.

      I suppose that my code is not properly set in order.

      If somebody could give me infomations, it will help me a lot. i apologize for my bad english.

      nb: is it possible to send my .fla on the forum?