A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: random frame

Hybrid View

  1. #1
    Drum & Bass Addict
    Join Date
    Dec 2000
    Posts
    519
    all i wanna do is make a keyframe in one of my movieclips goto a random frame (in its own timeline)..easy huh??

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    1,180
    Hi..
    The following code will go to a random frame between 1 & 5:

    ranNum = Math.floor(Math.random()*5)+1;
    gotoAndStop (ranNum);

    Adjust to the amount of frames your targeting.

    Hope this helps.

  3. #3
    Senior Member
    Join Date
    Nov 2000
    Posts
    237
    this is from me

    onClipEvent (load) {
    tellTarget (this) {
    gotoAndPlay (random(totoal frame of ur mc));
    }
    }

    any othere suggestion plz..

  4. #4
    Drum & Bass Addict
    Join Date
    Dec 2000
    Posts
    519
    thx alot guys.....i appreciate it..i actually tried them both..and they seem to work almost identical..but the second one seems to be more random than the first, if that makes any sense..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center