|
-
Randomly load different movies INSIDE a movie? Flash 4 or 5
Is it possible to randomly load/display movies inside a .swf? For example, I'll use a simple java ticker effect with say 10 sentences.
Can you randomly have let's say #3 scroll, then fade out (as an independent movie), then when it's done, have another random sentence, let's say #7 scroll, then fade out. And it just keeps randomly looping through those 10 sentences?
I've looked around for a tutorial, but can't find anything.
-
forever Newbie
HI there!
I'm not sure if this is going to help (since it's MX code) but anyway this can give you a hint...yesterday i've made a random external movie clip load sucessfuly. My code looks like this
Code:
variavel = random(5);
if (Number(variavel) == 0) {
loadMovie("flash/orappa.swf", "discohold");
} else if (Number(variavel) == 1) {
loadMovie("flash/rappamundi.swf", "discohold");
} else if (Number(variavel) == 2) {
loadMovie("flash/ladobladoa.swf", "discohold");
} else if (Number(variavel) >= 3) {
loadMovie("flash/instinto.swf", "discohold");
}
Well... the fades you mention are not there... but at least you have a clue of how make the movie load randomly!
-
Thanks much, but I don't have Flash MX, I'm running 4 and 5
-
array
nested if then elses can be long, I prefer arrays for multiple values. I think this should work in 5. If not, do a help search for "arrays" and "random function" for exact syntax.
swfArray = new Array ("1file.swf", "2file.swf", "3file.swf", "4file.swf"... "10file.swf");
function randomSwf() {
randomNumber = random (swfArray.length);
loadMovie (swfArray[randomNumber], "emptyMCinstanceName");
}
randomSwf();
-
P.S.
Put the fades in each swf file. Fade in and fade out. That will create a smooth transition between them.
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
|