Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/09/2010, 04:00
Ojete
 
Fecha de Ingreso: agosto-2010
Ubicación: Oakland california
Mensajes: 393
Antigüedad: 13 años, 8 meses
Puntos: 3
Como hacer esto en boton play pause?

Hola, soy novato y necesito saver como hacer esto, ya avia publicado un tema antes pero no consegui una respuesta satisfactoria, el caso es que quiero poner la ruta del mp3 directo en el codigo html y no en ventana acciones de flash, este es el reproductor que tengo. desde ya gracias por su ayuda....


estas son las variables de ventana acciones de flash:



Código PHP:

onClipEvent
(load) {

// the file path of the MP3 file that will be played.
targetMP3 "canciones/cancion.mp3";

// this variable tells Flash how loud the volume of the audio should be. 100 = max (loudest), 0 = min.
audioVolume 100;

// the main hex color of the button.
mainColor "130050";

// the secondary hex color of the button.
accentColor "789EE4";

// action performed when the MP3 finishes. Set to "loop", "next", "nextAndLoop", or "none".
whenFinished "none";

// when set to true, music will start playing automatically,
playAtStart false;

// when set to true, music stops when the button is pressed. When set to false, music will pause instead.
stopWhenPressed false;

// when set to true, snaps the movie clip to whole pixel coordinates.
snapPosition true;

// when set to true, pressing this button will stop other audio buttons on the same movie clip.
stopOthers true;

// when set to true, pressing this button will stop all audio buttons in the movie.
stopAll false;








Código PHP:




// this variable tells flash which symbol should be shown on the button.
currentSymbol 1;

// this variable tells Flash if audio is trying to play (it may be loading).
audioPlaying false;

// this variable tells Flash what position the song was paused at.
audioPosition 0;


faceMain.onPress = function() {
    
    
    if(
audioPlaying) {
        
        
        
pauseOrStopAudio();
        
    }else{
    
        
        
playAudio(false);
            
    }
        
    
whiteFlash.gotoAndPlay(1);
    
}

faceMain.onRollOver = function() {

    
rollOverMC._visible true;
        
}

faceMain.onRollOut = function() {

    
rollOverMC._visible false;
        
}

function 
playAudio(wasAuto) {
    
    
audioPlaying true;
    
    if(
audioPosition && !wasAuto) {
        
        
currentMP3.start(audioPosition 1000);
    
    }else{
        
        
refreshSoundObject();
        
        
currentMP3.loadSound(targetMP3true);
        
    }
    
    
    
currentMP3.setVolume(audioVolume);
    
    
    
currentSymbol 2;
    
    
    
faceSymbol.play();
    
    
    
this.onEnterFrame = function() {
    

        if(
currentSymbol != 2) {
            
            
            
this.onEnterFrame null;
        
    
        }else if(
currentMP3.position 0) {
            
            
            
currentSymbol playingSymbol;
            
            
            
faceSymbol.play();
            
            
            
this.onEnterFrame null;
            
        }
            
    }
    
    
    if(
stopAll && !wasAuto) {
        
        
        for(
i in _global.d87pab_PABArray) {
            
            
            if(eval(
_global.d87pab_PABArray[i]) != this) {
                
                
                eval(
_global.d87pab_PABArray[i]).pauseOrStopAudio();

            }
            
        }        
        
    }else if(
stopOthers && !wasAuto) {
        
        
        for(
i in _parent.d87pab_PABArray) {
            
        
            if(eval(
_parent.d87pab_PABArray[i][0]) != this) {
                
                eval(
_parent.d87pab_PABArray[i][0]).pauseOrStopAudio();
                
            }
            
        }
        
    }
    
}


function 
pauseOrStopAudio() {
    
    
    if(
stopWhenPressed) {
        
        
        
stopAudio();
        
    
    }else{
        
        
        
pauseAudio();
        
    }
    
}


function 
pauseAudio() {


    
audioPlaying false;
    

    if(
currentSymbol != 1) {
        
        
        
currentSymbol 1;
            
    
        
faceSymbol.play();
        
    }
    
    
audioPosition currentMP3.position;

    
    
currentMP3.stop();
    
}


function 
stopAudio() {
    
    
    
pauseAudio();
    
    
    
audioPosition 0;
    
}


function 
audioFinished() {

    
    
stopAudio();

    
    if(
whenFinished == "loop") {
        
        
        
playAudio(true);
    
    }else if(
whenFinished == "next" || whenFinished.toLowerCase() == "nextandloop") {
    
    
        
_parent.d87pab_PABArray.sort(organizePositions);
        
        
        for(
i in _parent.d87pab_PABArray) {
            
            
            if(eval(
_parent.d87pab_PABArray[i][0]) == this) {
        
                
                if(eval(
_parent.d87pab_PABArray[(parseInt(i10) + 1)][0]) != undefined) {
                
                    eval(
_parent.d87pab_PABArray[(parseInt(i10) + 1)][0]).playAudio(true);
                    
                
                }else if(
whenFinished.toLowerCase() == "nextandloop") {
            
                
                    eval(
_parent.d87pab_PABArray[0][0]).playAudio(true);
                        
                }
                
            }
            
        }
            
    }
    
}


function 
organizePositions(itemAitemB) {
    
    if(
itemA[1] > itemB[1] ) {
        
        
        return 
1;
    
        
    }else if(
itemA[1] < itemB[1] ) {
        
        
        return -
1;
        
    
    }else{
        
        
        return 
0;
        
    }
}


function 
refreshSoundObject() {

    
    if(
currentMP3 != undefined) {
        
        
        
delete currentMP3;
        
    }
    
    
    
currentMP3 = new Sound (this);
    
    
    
currentMP3.setVolume(audioVolume);

    
    
currentMP3.onSoundComplete = function() {
    
        
        
audioFinished();
    
    }
    
}


function 
findOtherButtons() {

  
f(_parent.d87pab_PABArray == undefined) {
        
        
        
_parent.d87pab_PABArray = [];
        
    }
    
    
    if(
_global.d87pab_PABArray == undefined) {
        
    
        
_global.d87pab_PABArray = [];
        
    }
    
    
    if(
forcedOrder != undefined) {
        
    
        
buttonOrder forcedOrder;
        
    }else{

        
buttonOrder this._x this._y;
            
    }
    
    
    
    
_parent.d87pab_PABArray.push([eval(this), buttonOrder]);
    
_global.d87pab_PABArray.push(eval(this));

}

function 
setVolumeNow(newVolume) {
    
    
audioVolume newVolume;
    

    
currentMP3.setVolume(audioVolume);
    
}


if(
stopWhenPressed) {
    
    
    
playingSymbol 4;
    

}else{
    
    
    
playingSymbol 3;
    
}


if(
snapPosition) {

    
this._x Math.round(this._x);
    
this._y Math.round(this._y);
        
}


if(
audioVolume == undefined) {


    
audioVolume 100;
        
}

if(
playAtStart) {


    
playAudio(true);
        
}

whiteFlash.gotoAndStop(6);


findOtherButtons();


rollOverMC._visible false;


stop(); 






este es el codigo html

Código PHP:
                <object type="application/x-shockwave-flash"  
                                         
data="reproductor.swf" width="40" height="40">
                    <
param name="movie" value="reproductor.swf" />
                    <
param name="quality" value="high" />
                    <
param name="bgcolor" value="#ffffff" />
                    <
param name="play" value="true" />
                    <
param name="loop" value="true" />
                    <
param name="wmode" value="window" />
                    <
param name="scale" value="showall" />
                    <
param name="menu" value="true" />
                    <
param name="devicefont" value="false" />
                    <
param name="salign" value="" />
                    <
param name="allowScriptAccess" value="sameDomain" /> 

Gracias x su ayuda...

Última edición por Ojete; 30/09/2010 a las 05:26