Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Flash/Flex > Flash > AS1/AS2
AS1/AS2 Questions relatives à la programmation ActionScript 1 et 2 (Cours AS2)
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 18/07/2008, 10h56   #1
Invité de passage
 
Inscription : avril 2008
Messages : 23
Détails du profil
Informations forums :
Inscription : avril 2008
Messages : 23
Points : 4
Points : 4
Par défaut Temporisation des images.

bonjour,

Je souhaite afficher des images pendant un certain temps. Mais je n'arrive pas à trouver une fonction de temporisation à mettre entre les actions.

Exemple :
_root.mcFusee.gotoAndStop(23);
// une tempo de 2 secondes
_root.mcFusee.gotoAndStop(50);

J'ai essayé avec ce code, mais ça part tellement vite qu'on a pas le temps de voir défiler les 4 images
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
for( temporisation = 0; temporisation <=3000; temporisation ++){
switch (temporisation){
case 0 :
    _root.mcFusee.gotoAndStop(1);					
    break;
case 1000 :
    _root.mcFusee.gotoAndStop(40);					
    break;
case 2000 :
    _root.mcFusee.gotoAndStop(80);					
    break;
case 3000 :
    _root.mcFusee.gotoAndStop(120);					
    break;
default :
    break;
}
Auriez-vous une solution car c'est urgent

Merci
Sarita04 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 18/07/2008, 22h42   #2
Invité de passage
 
Inscription : juillet 2008
Messages : 4
Détails du profil
Informations forums :
Inscription : juillet 2008
Messages : 4
Points : 4
Points : 4
A moins que je n'ai pas compris ton but je te propose l'utilisation de setinterval.
ca donnerais

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var temporisation:Number = 0;
myInt = setInterval(tampon, 400);
function tampon() {
	temporisation++;
	if (temporisation == 1) {
		_root.mcFusee.gotoAndStop(1);
	}
	if (temporisation == 2) {
		_root.mcFusee.gotoAndStop(40);
	}
	if (temporisation == 3) {
		_root.mcFusee.gotoAndStop(80);
	}
	if (temporisation == 4) {
		_root.mcFusee.gotoAndStop(120);
		clearInterval(myInt);
	}
}
hoolay est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 21h41.


 
 
 
 
Partenaires

Hébergement Web