Flash lecteur MP3 va un peu détraqué

  • ksufan
  • Born
  • Born
  • No Avatar
  • Inscription: Avr 21, 2009
  • Messages: 1
  • Status: Offline

Message Avril 25th, 2009, 3:21 pm

Vous avez un petit problème. Im la construction d'un flash de lecteur mp3. Certains comment les boutons Suivant et Précédent fonctionnent, mais parfois la lecture / pause et stop boutons fonctionnent de temps en temps. Que fais-je tort? Voici le code en AS 3.0

Code: [ Select ]
 
var playing:Boolean = false;
var pausePoint:Number = 0;
 
stopbutton.addEventListener(MouseEvent.CLICK, stopButtonClick);
 
function stopButtonClick(event:MouseEvent):void {
    theChannel.stop();
    pausepoint = 0;
 
 
}
 
 
 
playpause_button.addEventListener(MouseEvent.CLICK, playpauseButtonClick);
function playpauseButtonClick(event:MouseEvent):void {
    playing = playing ? false : true;
    if (playing) {
 
        theChannel = theSound.play(pausePoint);
    } else {
 
        pausePoint = theChannel.position;
        theChannel.stop();
    }
}
 
prev_button.addEventListener(MouseEvent.CLICK, prevButtonClick);
 
function prevButtonClick(event:MouseEvent):void {
 
    if (b > 1) {
        b = b - 1;
        theChannel.stop();
        gotoAndPlay("startTrack");
    } else {
        b = this.totalfiles;
        theChannel.stop();
        gotoAndPlay("startTrack");
    }
}
 
 
next_button.addEventListener(MouseEvent.CLICK, nextButtonClick);
 
function nextButtonClick(event:MouseEvent):void {
 
    if (b < this.totalfiles) {
        b = b + 1;
        theChannel.stop();
        gotoAndPlay("startTrack");
    } else {
        b = 1;
        theChannel.stop();
        gotoAndPlay("startTrack");
    }
}
 
 
 
  1.  
  2. var playing:Boolean = false;
  3. var pausePoint:Number = 0;
  4.  
  5. stopbutton.addEventListener(MouseEvent.CLICK, stopButtonClick);
  6.  
  7. function stopButtonClick(event:MouseEvent):void {
  8.     theChannel.stop();
  9.     pausepoint = 0;
  10.  
  11.  
  12. }
  13.  
  14.  
  15.  
  16. playpause_button.addEventListener(MouseEvent.CLICK, playpauseButtonClick);
  17. function playpauseButtonClick(event:MouseEvent):void {
  18.     playing = playing ? false : true;
  19.     if (playing) {
  20.  
  21.         theChannel = theSound.play(pausePoint);
  22.     } else {
  23.  
  24.         pausePoint = theChannel.position;
  25.         theChannel.stop();
  26.     }
  27. }
  28.  
  29. prev_button.addEventListener(MouseEvent.CLICK, prevButtonClick);
  30.  
  31. function prevButtonClick(event:MouseEvent):void {
  32.  
  33.     if (b > 1) {
  34.         b = b - 1;
  35.         theChannel.stop();
  36.         gotoAndPlay("startTrack");
  37.     } else {
  38.         b = this.totalfiles;
  39.         theChannel.stop();
  40.         gotoAndPlay("startTrack");
  41.     }
  42. }
  43.  
  44.  
  45. next_button.addEventListener(MouseEvent.CLICK, nextButtonClick);
  46.  
  47. function nextButtonClick(event:MouseEvent):void {
  48.  
  49.     if (b < this.totalfiles) {
  50.         b = b + 1;
  51.         theChannel.stop();
  52.         gotoAndPlay("startTrack");
  53.     } else {
  54.         b = 1;
  55.         theChannel.stop();
  56.         gotoAndPlay("startTrack");
  57.     }
  58. }
  59.  
  60.  
  61.  


Merci à l'avance.
  • Anonymous
  • Bot
  • No Avatar
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Avril 25th, 2009, 3:21 pm

Afficher de l'information

  • Total des messages de ce sujet: 1 message
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 94 invités
  • Vous ne pouvez pas poster de nouveaux sujets
  • Vous ne pouvez pas répondre aux sujets
  • Vous ne pouvez pas éditer vos messages
  • Vous ne pouvez pas supprimer vos messages
  • Vous ne pouvez pas joindre des fichiers
 
 

© 2011 Unmelted, LLC. Ozzu® est une marque déposée de Unmelted, LLC