PDA

View Full Version : MediaPlayback halts on setMedia


Linnium
07-22-2006, 09:03 PM
Hello,

I have a MediaPlayback component on the canvas, and I've given it the name "mp3Player". On the frame, I put in the following code:
var playList:Array = new Array("track01.mp3", "track02.mp3", "track03", "track04.mp3");
_global.i = 0;
mp3Player.setMedia(playList[_global.i]);
var controlListen:Object = new Object();
controlListen.playheadChange = function(eventObj:Object) {
mp3Player.setMedia(playList[_global.i+1]);
};
mp3Player.addEventListener("playheadChange", controlListen);
When I hit the "Play" button ont he component, it plays "track01.mp3" just fine. But, if I hit the "Go To End" button, the fuction of the listener is triggered, and the playhead viewer returns to zero, but won't play. Even when I toggle the "Play/Pause" button.

This is obviously a simplified version of what I want to accomplish, but does anyone know what I'm missing in order for it to play the next song in the array? Thanks!

Linnium
07-26-2006, 02:03 AM
No one, aye?