-
Newbie Infantry
Random URL's
I have 10 different SWF movies.
I want to make a banner out of them.
At the end of each SWF movie I need to put a code that would randomly load 1 of the 10 defferent SWF movies.
Can someone help me out? How can this be done or CAN it be done.
Thnx!
I'm still learning Flash!
-
Senior Member
At the end of each movie, write this code
moviename=["mov1","mov2"....]; //this array has the names of the other 9 movies
loadMovieNum(moviename[Math.random(moviename.length)],1);
tell me if it works
-
Newbie Infantry
Doesn't work...
I input the script and there are no errors in the script but the movie just keeps playing in loops, doesn't go to a different movie.
I tried to scripts:
code: moviename=["movie1.swf","movie2.swf","movie3.swf","movie4.swf ","movie5.swf","movie6.swf","movie7.swf","movie8.s wf","movie9.swf","movie10.swf"]; //this array has the names of the other 9 movies
loadMovieNum(moviename[Math.random(moviename.length)],1);
and I also tried movie2 (without the extension)
I'm still learning Flash!
-
Senior Member
Ok, first of all, all these movies should be in the same folder
second change this line
loadMovieNum(moviename[Math.random(moviename.length)],1);
to
loadMovieNum(moviename[Math.random(moviename.length)],0);
I'm almost sure it should work
-
Newbie Infantry
Here is the script I used:
code: moviename=["movie1.swf","movie2.swf","movie3.swf","movie4.swf "]; //this array has the names of the other 9 movies
loadMovieNum(moviename[Math.random(moviename.length)],0);
The movie now goes and when it reaches the frame with the code it goes blank.
And I do have all my movies in one folder.
I'm still learning Flash!
-
Newbie Infantry
Wessamzeidan, I found this tutorial. Except it works everytime the movie is loaded, I need it to randomely generate everytime the movie is over. Maybe you can show me how to make it work like that?
http://www.flashkit.com/tutorials/Fl...-671/index.php
I'm still learning Flash!
-
Newbie Infantry
I'm still learning Flash!
-
Senior Member
Hey sorry, there was a mistake, try it now
moviename=["movie1.swf","movie2.swf","movie3.swf","movie4.swf ","movie5.swf","movie6.swf","movie7.swf","movie8.s wf","movie9.swf","movie10.swf"]; //this array has the names of the other 9 movies
loadMovieNum(moviename[random(moviename.length)],1);
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
|