Selteco.com > FlashDesignerZONE.com > Tutorials > T1072

Display frames in random order.

Download source project t1072.zip (3 kb)

  1. Launch Flash Designer and choose Blank
  2. Set movie dimensions 230 x 100 (or any desired) with Frame > Frame Size
  3. Choose "Frame" > "Insert", put Count: 6 and duration 2 seconds
  4. Change frame 1 delay to "0.05".
  5. Choose "Frame" > "ActionScript" and paste the code:
    
    // generate random number (f) but different than the last one (l)
    // the number will be between 1 and 6
    
    while(f==l) { f = Math.Floor(Math.Random()*6)+1; }
    
    // remember the last random number
    l = f;
    
    
    // jump to a frame 
    if(f==1) gotoAndPlay("Frame 2");
    if(f==2) gotoAndPlay("Frame 3");
    if(f==3) gotoAndPlay("Frame 4");
    if(f==4) gotoAndPlay("Frame 5");
    if(f==5) gotoAndPlay("Frame 6");
    if(f==6) gotoAndPlay("Frame 7");
    
    
  6. Put graphics on each frame (from Frame 2 to Frame 7) for example numbers
  7. For each Frame 2 to Frame 7 choose "Frame" > "Loop" and select "After this frame jump to frame:" Frame 1.
  8. Choose "Movie" > "Export Options" and change "SWF Version": Flash Player 6.
  9. Hit F9 for preview.

Products | Purchase | Downloads | Support | Flash Tutorials | Contact
Copyright © 1999-2017 Selteco Software, Inc. www.selteco.com, ph: +1 810 377 5778