Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Galera. Tenho problemas também para personalizar meu player não consigo fazer com que ele comece tocar a primeira música da lista do xml, automaticamente sem ter que clicar no player
confiram neste endereço: MP3 PLAYER
Ele funciona muito bem, mas tá difícil de fazer esta personalização..
código:
AudioXml = new XML();AudioXml.ignoreWhite = true;AudioXml.onLoad = LoadXmlFile;AudioXml.load(playListPath);function LoadXmlFile(success) { if (success) { aPath = new Array(); asongTitle = new Array(); aAudio = new Array(); aAudio = this.firstChild.childNodes; AudioTotal = aAudio.length; for (i=0; i<AudioTotal; i++) { if (aAudio[i].nodeName == "AudioProps") { aPath.push(aAudio[i].attributes.path); asongTitle.push(aAudio[i].attributes.songTitle); } } AudioPath = aPath[0]; tAuthor = asongTitle[0]; AudioActual = 1; tCount = AudioActual+" Of "+AudioTotal; tText = "Xml Loaded"; } else { tText = "Xml not loaded"; }}Ff.onPress = function() { if (AudioActual<AudioTotal) { AudioActual += 1; AudioPath = aPath[AudioActual-1]; tAuthor = asongTitle[AudioActual-1]; MySound.stop(); Mystatus = "Press Play"; }};Rw.onPress = function() { if (AudioActual>1) { AudioActual -= 1; AudioPath = aPath[AudioActual-1]; tAuthor = aSongTitle[AudioActual-1]; MySound.stop(); Mystatus = "Press Play"; }};PlayBtn.onPress = function() { if (FlagPausa == true) { MySound.start(SoundPausePos, 0); FlagPausa = false; SoundPausePos = undefined; } else { MySound = new Sound(); volume = 100; MySound.setVolume(volume); MySound.loadSound(AudioPath, StreamFlag); FlagPausa = false; _parent.onEnterFrame = function() { TB = MySound.getBytesTotal(); BL = MySound.getBytesLoaded(); if (BL != TB) { TheText2.text = Math.round((BL/TB)*100)+"% Loaded"; } else { TheText2.text = "100% Loaded"; delete _parent.onEnterFrame; MySound.start(); } }; }};StopBtn.onPress = function() { MySound.stop(); Mystatus = "Press Play";};PauseBtn.onPress = function() { SoundPausePos = MySound.position/1000; MySound.stop(); FlagPausa = true;};volUp.onPress = function() { if (volume == 100) { volume = 100; } else { volume += 10; MySound.setVolume(volume); }};volDown.onPress = function() { if (volume == 0) { volume = 0; } else { volume -= 10; MySound.setVolume(volume); }};
Agradeço de coração... Já estou desesperado com isso!!!!
****
knoou
Carregando comentários...