-
CS3: Random videos
Could someone please guide me in the right direction on how to play videos randomly? For example, if I have 5 videos in a flash file, how can I make the player play the 5 videos randomly on every page refresh?
Thank you for your time
-
I have not tested this code, I give it just to ilustrate:
var myList:Array = new Array(myVid1, myVid2, myVid3, myVid4, myVid5);
var i = Math.floor(myList.length * Math.random());
var randomVideo:Video = myList[i];
and than you use randomVideo for whatever you need.
Hope this helps
-
Originally Posted by malcek
I have not tested this code, I give it just to ilustrate:
var myList:Array = new Array(myVid1, myVid2, myVid3, myVid4, myVid5);
var i = Math.floor(myList.length * Math.random());
var randomVideo:Video = myList[i];
and than you use randomVideo for whatever you need.
Hope this helps
Thank you for your help and I copied the code down and tested 2 videos, but they both play at the same time. Am I supposed to replace any thing in the code? I'm sorry, I am very new to AS2.
Thank you
-
Oh by the way, the code needs to be in AS2.
Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|