IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Flash Discussion :

[FLASH MX2004] Lire plus de titre dans un player


Sujet :

Flash

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Août 2004
    Messages
    22
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2004
    Messages : 22
    Points : 20
    Points
    20
    Par défaut [FLASH MX2004] Lire plus de titre dans un player
    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 :

    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;
    };
    Merci à tous.

  2. #2
    Expert éminent

    Avatar de freegreg
    Profil pro
    Inscrit en
    Août 2002
    Messages
    4 376
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : France, Gard (Languedoc Roussillon)

    Informations forums :
    Inscription : Août 2002
    Messages : 4 376
    Points : 8 779
    Points
    8 779
    Par défaut
    J'ai plus trop le temps de regarder maintenant mais si tu double-cliques sur ton textInput (dans la timeline tu dois etre dans groupe), tu regardes le code tu verras
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    if (input>3) {
       input = 11;
    }
    d'où sort ce 11 C'est toi qui l'a mis?
    Tu re-double-cliques (groupe/groupe) tu reverras :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    if (input>3) {
      input = 11;
    }
    re- d'où sort ce 11 C'est toi qui l'a mis?

    J'ai pas trop compris à quoi cela était dû mais cela explique ton bug
    Avant toutes questions, consultez nos différentes ressources disponibles gratuitement : XML, Développement Web, Flash/Flex, (X)HTML, CSS, JavaScript, AJAX, ASP
    Offres d'emploi développeur Web

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Août 2004
    Messages
    22
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2004
    Messages : 22
    Points : 20
    Points
    20
    Par défaut
    En effet, c'était bien ça... Merci

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 9
    Dernier message: 06/03/2006, 20h22
  2. Réponses: 4
    Dernier message: 02/11/2004, 20h11
  3. Réponses: 2
    Dernier message: 21/10/2004, 12h29
  4. Réponses: 4
    Dernier message: 05/10/2004, 17h11
  5. [FLASH MX2004] Alignement d'un swf dans un autre swf
    Par mike-sixteen dans le forum Flash
    Réponses: 3
    Dernier message: 09/08/2004, 11h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo