Bonjour,
J'ai récupéré le "mp3 player" qui est dans les exemples de Flash MX 2004. Il s'agit du fichier load_sounds.fla ( fichier dispo ici : http://vjarielle.free.fr/load_sounds.fla ). Je veux pouvoir lire plus de 3 chansons avec ce player, donc j'ai modifié les lignes 21 ( je remplace 3 par 11 ) et 47 ( même modification ). Cependant, le nombre des chansons ne s'affiche plus aprés la 3 éme chanson ( il apelle toutes les chansons 11 ).
Je suis pas hyper fort en code... alors, j'aimerais bien que quelqu'un m'explique d'où vient mon probléme.
Voilà le code original des actions :
Merci à tous.
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
59
60
61 // initialize variables whichSound = 1; playing = false; looping = false; // // create an instance of the Sound object mySound = new Sound(); // initialize(1); function initialize(whichSound) { mySound.stop(); mySound.loadSound("../sounds/sound"+whichSound+".mp3", false); newPosition = 0; playing = false; input = whichSound; transport.fader._x = transport.left; } // // previuos and next buttons next.onPress = function() { if (whichSound<3) { whichSound++; initialize(whichSound); } }; back.onPress = function() { if (whichSound>1) { whichSound--; initialize(whichSound); } }; // // when selected sound reaches the end... mySound.onSoundComplete = function() { //mysound.stop(); newPosition = mySound.duration/1000; if (looping) { mySound.start(0, 1); } else { playing = false; } }; // this.onEnterFrame = function() { // limit input field if (input>3) { input = 3; } // // initiate change to new sound when Enter key is pressed if (Key.isDown(Key.ENTER) && whichSound != input) { whichSound = input; initialize(whichSound); } }; // // if a number is entered in the input field but Enter is not pressed, change // back to current sound number when clicking anywhere else inputField.onKillFocus = function() { input = whichSound; };
Partager