A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: load randon movie once (no repeat)

  1. #1
    Junior Member
    Join Date
    Jul 2001
    Posts
    2
    Does anyone know how load non repetative random movies (swf). I want to load ten of them. Please let me know how to do this. Thanks a lot!

  2. #2
    Senior Member
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    437
    Here, just a quick solution. Hope this helps
    Code:
    onClipEvent (load){
    	myArray = new Array ("a", "b", "c", "d", "e", "f", "g", "h", "i", "j");
    	last = myArray.length - 1;
    	i = 10;
    }
    onClipEvent (MouseDown){
      if (last >= 0){
    	index = random(i);
    	array = myArray[index];
    //trace ("char: " + myArray[index] + " index: " + index + " random: " + i + " length: "+last);
    	myArray[index] = myArray[last];
    	last--;
    	i--;
       }
    }

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