Bonjour,
J'aimerai faire un système pour afficher des images toutes les 5 secs.
Voici mon code :
Le problème est que dans ma fonction timer.onEnterFrame cela n'appelle pas la fonction image.
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 var etat:String = "loading"; img = 1; timer.timeStarted=getTimer()/1000; timer.interval=5; // Afficher/masquer masque._visible = false; pBar._visible = true; mini.swapDepths(2); stop(); image(); function image () { trace("hello"); timer.interval +=5; removeMovieClip(image); image = createEmptyMovieClip("image",1); image.loadMovie("../news/" + img + ".jpg"); if(img==5) img=1; image.swapDepths(1); this.onEnterFrame = function() { var total:Number = image.getBytesTotal(); var chargement:Number = image.getBytesLoaded(); var pourcentage:Number = Math.round(chargement/total*100); if (pourcentage == 100) { delete this.onEnterFrame; _root.image.setMask("masque"); pBar._visible = false; etat = "loaded" }else{ pBar.setProgress(chargement, total) } } } timer.onEnterFrame = function() { if(etat=="loaded") { if((getTimer()/1000) > (this.timeStarted+this.interval)) { trace("ok"); _parent.image(); timer.interval +=5; } } }
Pouvez-vous m'aider ???
Merci beaucoup
Partager