3 Replies Latest reply on Mar 7, 2010 4:43 PM by Ned Murphy

    Random Symbol display on Timeline

    kayzerszosse

      Hello Flash Gurus,

       

      i am trying to find a script which displays my frames on a timeline randomly (and shows them for a second or so).

       

      I did find a script but when i place the movieclip a couple of times over my stage - what happens is that the random script is not working anymore.

       

      I think its easy to fix for someone knowing action script...

       

       

      you can find the flash file here

       

      http://www.h-t.com.au/THEA0012_banner-tryout_v1.fla.zip

       

       

      Thank you so much for your help...

       

      K

        • 1. Re: Random Symbol display on Timeline
          Ned Murphy Adobe Community Professional & MVP

          I cannot open your file and others will not as a general rule, so if you can explain what you have done and the code you have used, there's a better chance you'll get some help.

           

          If you have a function that gets called by some form of timed code, then that function and code should be available for the full length of the timeline, meaning it should live in a layer in frame 1 and that layer should extend the full length of the timeline without interuption by other keyframes/content..

          1 person found this helpful
          • 2. Re: Random Symbol display on Timeline
            kayzerszosse Level 1

            Hey Ned, thanks for your help.

             

            I have used a script on a keyframe for the movie clip called MyMc. I found this on flashkit and it works for that movie.

            But when i duplicate the movie its not working anymore.

             

            Ideally as a result i need a movieclip which contains many instances of a movieclip which plays randomly the symbols placed on the timeline.

             

            I want them containing in a big movievip to be able to scale the whole thing (zooming out)

             

            This is the script:

             

            myMc.stop();
            time  = getTimer();
            wait = 500;//1000ms = 1 second
            _root.onEnterFrame = function(){
                if (getTimer() > time+2000){
                    myMc.gotoAndStop(random(myMc._framesloaded)+1);
                    time = getTimer();
                }
            }

             

             

            It would probably help already if i have the script on the actual movie rather than on the timeline but i dont know what needs to be changed.

             

            Cheers

            • 3. Re: Random Symbol display on Timeline
              Ned Murphy Adobe Community Professional & MVP

              I don't follow the explanation as far as what you are doing, so I can't offer much.  I get confused between your describing different movies... I'm not sure which is which.

               

              But if you are duplicating an object/instance and try to use the same code to control it, the problem may be that you need to have new instance names for each instance and code that talks to those differently named instances.

               

              If I am getting some idea of what you are doing, then you might try placing that code inside the movieclip that you are duplication, and instead of using its instance name, use "this"

               

              stop();
              var time  = getTimer();
              this.onEnterFrame = function(){
                  if (getTimer() > time+2000){
                      this.gotoAndStop(random(this._framesloaded)+1);
                      time = getTimer();
                  }
              }

              1 person found this helpful