A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Random Play

  1. #1
    Senior Member
    Join Date
    Dec 2000
    Posts
    118
    How can i make an mc to play at a random time during my movie?

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    296
    try putting this code in the MC:

    Code:
    onClipEvent(load){
      counter = 0;
      //generate a random number between 499 and 1499
      rnd = random(1000)+500;
    }
    onClipEvent(enterFrame){
      counter++;
      if(counter>= rnd){
        this.play();
      }
    }
    this uses a counter to count frames, but you could easily use the built in flash function getTimer()

  3. #3
    Senior Member
    Join Date
    Dec 2000
    Posts
    118
    thats all? do i have to set n e variables ore n e thing?

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