A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: simple random screensaver

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    167

    simple random screensaver

    hi flashers

    i'm trying to build a very simple screensaver. i have built 7 MovieClips that play perfectly.

    on the main time line i have frame 1 which is empty and then the seven MovieClips on seperate frames one after each other on the main timeline... these all play in order as they have a simple

    stop();
    _parent.play(1);

    at the end of each MovieClip timeline...

    what i want is a very simple piece of code that can go into frame one of the main timeline and randomly push the playhead to one of the 7 different MovieClips...

    Any ideas?

    Thanks

  2. #2
    Junior Member
    Join Date
    Apr 2005
    Location
    Lisboa
    Posts
    10
    Here you go, just paste it on the first frame of the main timeline


    stop();
    this.onEnterFrame = function() {
    b = random(7);
    gotoAndPlay(b+1);
    };
    Eduardo

  3. #3
    Junior Member
    Join Date
    Apr 2005
    Location
    Lisboa
    Posts
    10
    If you want it to choose one frame and just stay there do this:


    stop();
    b = random(7);
    this.onEnterFrame = function() {

    gotoAndPlay(b+1);
    };
    Eduardo

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