random flash movie
- Started
- Last post
- 6 Responses
- k77
how do i load a random movie clip into my main time line?
(i've tried searching the PV-AN and google, and flashkit i think, but they all suck compared to you guys) :)
More than love coming to the helping party.
- tara|gee0
:) hi
- versa0
say you have 8 "random" MC choices:
here's one approach...there are other ways...
depth=0;
choice = Math.floor ((Math.random() * 8) + 1);
switch (choice)
{
case 1 :
this.attachMovie ("foo1MC", "fooMC", depth++);
break;case 2 :
this.attachMovie ("foo2MC", "fooMC", depth++);
break;case 3 :
this.attachMovie ("foo3MC", "fooMC", depth++);
break;case 4 :
this.attachMovie ("foo4MC", "fooMC", depth++);
break;case 5 :
this.attachMovie ("foo5MC", "quoteMC", depth++);
break;case 6 :
this.attachMovie ("foo6MC", "fooMC", depth++);
break;case 7 :
this.attachMovie ("foo7MC", "fooMC", depth++);
break;case 8 :
this.attachMovie ("foo8MC", "fooMC", depth++);
break;default:
trace ("no case tested true")
}
- squidfingers0
movies = ["mov1.swf","mov2.swf","mov3.swf...
holder_mc.loadMovie (movies[Math.floor(Math.random() * movies.length)]);
- k770
versa,
would that work if it were...
on click and then all of that.
i need my flashplet to load 2 random images at the same time, as the user releases his/her click. you feel me?
- k770
btw, hi tara :)
interesting squidfingers.
- versa0
sure.........just put the switch statment in an onClick handler for a button...........
then load on _root like the example or into another MC of choice
no pun intented
!