Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/06/2011, 12:11
stpy
 
Fecha de Ingreso: junio-2011
Mensajes: 23
Antigüedad: 12 años, 10 meses
Puntos: 0
Respuesta: problema boton as3 y reproductor mp3 xml

Perdona, pero ya he visto que faltan datos para que me entiendas...

el archivo que quiero detener no es un .mp3 sino una playlist con varios mp3

el archivo xml está cargado con el siguiente código:

stop();




var myFormat:TextFormat = new TextFormat();
myFormat.color = "0xFFFFFF";
myFormat.size = 13;

list.setRendererStyle("textFormat", myFormat);

//////////////////////////////////////////////////////////////////////////////////////////////////

// Initialize variables
var trackToPlay:String;
var pausePosition:int = 0;
var songURL:URLRequest;
var isPlaying:Boolean = false;
var i:uint;
// Initialize the XML, place the xml file name, initialize the URLRequest
// put URLRequest into a new URLLoader, and add event listener on
// myLoader listening for when the XML loading is complete
var myXML:XML = new XML();
var XML_URL:String = "disco7.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);

// Create the xmlLoaded function. What happens when the XML file is fully read
function xmlLoaded(event:Event):void {

// Place the xml data into the myXML object
myXML = XML(myLoader.data);
// Access song 1 in the XML file to start the player
var firstSong:String = myXML..Song.songTitle[0];
var firstArtist:String = myXML..Song.songArtist[0];
songURL = new URLRequest("mp3_files_disco7/" + firstSong + ".mp3");
status_txt.text = "1. "+firstSong +" - "+firstArtist;
// Run the "for each" loop to iterate through all of the song items listed in the external XML file
for each (var Song:XML in myXML..Song) {

i++; // Increment the song counter by one
// Access the value of the "itemColor" node in our external XML file
var songTitle:String = Song.songTitle.toString();
// Access the value of the "itemLabel" node in our external XML file
var songArtist:String = Song.songArtist.toString();
// Adds each song into the list component through this loop
list.addItem( { label: i+". "+songTitle+" - "+songArtist, songString: songTitle, Artist: songArtist, songNum: i } );

}
var myArray = new Array (0,0);
list.selectedIndices = myArray; // This highlights song 1 by default
gotoAndStop(3);

}



Necesito que al pulsar un botón, se detenga el sonido, y vaya a la etiqueta playIlustrador. Si necesitas otra parte del código dímelo y lo posteo.
Gracias..