|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Trying to find the easiest, most straightforward way to make a handful of movie
clips load in a random order. I'm sure this is a terribly simple effect to achieve for experienced Flash users. Total newbie here against a tight deadline. Any would be greatly appreciated. You can see a sample of my movie as it sits now... just need the different quotes to load randomly as opposed to a static loop: http://jqcreative.com/testimonials.swf |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
you can place the clips into an array and use this popular method:
Array.prototype.shuffle = function() { for (var ivar = this.length-1; ivar>=0; ivar--) { var p = random(ivar+1); var t = this[ivar]; this[ivar] = this[p]; this[p] = t; } }; |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
put this on the first frame of the movie that loads the random swf.
// make a list of the files to load, the name should be a numerical secuence, could be .jpg, .gif, .png or .swf filename = ["1.swf", "2.swf", "3.swf", "4.swf", "5.swf", "6.swf", "7.swf"]; // name of the floder containg the files to load path = "banners/"; i = filename.length; k = Math.floor(Math.random()*i); // load files into a movieclip instace name loader_mc loadMovie(path+filename[k], this.loader_mc); |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Thanks so much for the guys. I'll see if I can get some results.
|
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
actually danivi - you should never name files beginning with a number, Flash
will throw errors here. Additionally, if you read the length of the array and do not subtract 1, you will get an occational undefined return beyond the last array index since they are 0 based. further, the OP indicates that they are MCs within a single file timeline, not external files. |
|
![]() |
| Outils de la discussion | |
|
|