Bonjour à tous
J'ai actuellement un soucis sur une animation flash que je suis en train d'écrire pour le réveillon de nouvel an.
Elle est composée comme suit:
Frame 1 : texte dynamique (la durée avant échéance en heur/minutes/secondes)
Frame 2: Un champ dynamique (durée en seconde)
Frame 3 à la fin, les images d'une animation que je souhaite afficher quand on arrive à 0
Les scripts sont les suivants:
Frame 1:
Frame 2:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 stop() currentDate = new Date(); thisYear = currentDate.getFullYear(); eventDate = new Date(2009, 0, 1, 0, 0, 0); eventMillisecs = eventDate.getTime(); this.onEnterFrame = function () { currentDate = new Date(); currentMillisecs = currentDate.getTime(); this.msecs = eventMillisecs - currentMillisecs; if ((this.days ==0) && (this.hours == 0) && (this.mins == 0) && (this.secs <= 10)) { goToAndPlay(2); } else { this.secs = Math.floor(this.msecs / 1000); this.mins = Math.floor(this.secs / 60); this.hours = Math.floor(this.mins / 60); this.days = Math.floor(this.hours / 24); this.msecs = String(this.msecs % 1000); this.secs = String(this.secs % 60); this.mins = String(this.mins % 60); this.hours = String(this.hours % 24); this.days = String(this.days); while (this.msecs.length < 3) { this.msecs = "0" + this.msecs; } if (this.secs.length < 2) { this.secs = "0" + this.secs; } if (this.mins.length < 2) { this.mins = "0" + this.mins; } if (this.hours.length < 2) { this.hours = "0" + this.hours; } this.decompte = this.hours+":"+this.mins+":"+this.secs; if (this.days > 0) { this.decompte = this.days+"Jours"; } } }
et enfin
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 stop() this.decompte =""; currentDate = new Date(); thisYear = currentDate.getFullYear(); eventDate = new Date(2009, 0, 1, 0, 0, 0); eventMillisecs = eventDate.getTime(); this.onEnterFrame = function () { currentDate = new Date(); currentMillisecs = currentDate.getTime(); this.msecs = eventMillisecs - currentMillisecs; if ((this.days <=0) && (this.hours <= 0) && (this.mins <= 0) && (this.secs <= 0)) { goToAndPlay(4); } else { this.secs = Math.floor(this.msecs / 1000); this.mins = Math.floor(this.secs / 60); this.hours = Math.floor(this.mins / 60); this.days = Math.floor(this.hours / 24); this.msecs = String(this.msecs % 1000); this.secs = String(this.secs % 60); this.mins = String(this.mins % 60); this.hours = String(this.hours % 24); this.days = String(this.days); while (this.msecs.length < 3) { this.msecs = "0" + this.msecs; } if (this.secs.length < 2) { this.secs = "0" + this.secs; } if (this.mins.length < 2) { this.mins = "0" + this.mins; } if (this.hours.length < 2) { this.hours = "0" + this.hours; } this.decompte = this.secs; } }
Frame 3:
Le compte a rebour s'affiche bien, à 10 secondes, je passe bien en frame 2
Code : Sélectionner tout - Visualiser dans une fenêtre à part Play();
Seulement arrivé à 0, j'ai la première frame de la vidéo qui s'affiche mais l'animation reste bloquée sur cette 1° frame !
Je ne vois pas ou est l'erreur, quelqu'un à une idée ?
Merci
Partager