PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Graphisme & Infographie > macromedia.flash > Simple Random Movie Clips Solution?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Simple Random Movie Clips Solution?

Réponse
 
LinkBack Outils de la discussion
Vieux 26/05/2008, 22h59   #1
jqcreative
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Simple Random Movie Clips Solution?

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

  Réponse avec citation
Vieux 26/05/2008, 23h41   #2
clbeech
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Simple Random Movie Clips Solution?

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;
}
};

  Réponse avec citation
Vieux 27/05/2008, 02h33   #3
danivi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Simple Random Movie Clips Solution?

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);

  Réponse avec citation
Vieux 27/05/2008, 03h23   #4
jqcreative
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Simple Random Movie Clips Solution?

Thanks so much for the guys. I'll see if I can get some results.
  Réponse avec citation
Vieux 27/05/2008, 13h29   #5
clbeech
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Simple Random Movie Clips Solution?

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.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h59.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10866 seconds with 13 queries