PDA

View Full Version : Combine Scripts??



BoonDock
February 1st, 2006, 11:58 AM
Ok so I have this script I want to use to do the transition effects between external movieclips:


_root.currMovie = "your_first_section_name";
container.loadMovie(_root.currMovie+".swf");
But, I want to load a random movie clip when this script is run and the script I'm using for this is here:



myArray = ["home_quote1.swf", "home_quote2.swf", "home_quote3.swf"];
randomClip = myArray[random(myArray.length)];
//usage
sub_nav.loadMovie(randomClip);


Is there any way to combine the two of these so it works correctly? PLEASE AND THANKS!

Boon.

B L U E
February 1st, 2006, 01:11 PM
I'm not positive if this is what you mean but:

_root.currMovie = "your_first_section_name";
myArray = ["home_quote1.swf", "home_quote2.swf", "home_quote3.swf"];
randomClip = myArray[random(myArray.length)];
container.loadMovie(randomClip);

BoonDock
February 1st, 2006, 02:04 PM
No that's not exactly it...

I want one of the random movies to be loaded as they should be (aka: randomly) but I want whatever one does get loaded to be inside _root.currMovie . . . that make sense?

BoonDock
February 1st, 2006, 02:51 PM
Got it! Here is the code:

myArray = ["home_quote1.swf", "home_quote2.swf", "home_quote3.swf"];
_root.currMovie = myArray[random(myArray.length)];
sub_nav.loadMovie(_root.currMovie);

:thumb:
-thanks anyways!