Hi All,
I was curious if there was some sort of stop command within LoaderMax? I'm building a mobile MP3 player and it loads fine every time the player launches, but the issue is caused when I hit the Play/Pause button. It works right the first time... playing & pausing. Next time I load it, and hit the Play/Pause button I get, "ArgumentError: Error #2068: Invalid sound."
I have unload and dispose being called during my closeFunction, but I don't think it is working.
When I click the menu item it autoPlays just fine. When I close it stops. Then I click on a different menu item, it loads and plays fine. I'm just having issues with the silly Play/Pause button.
//This is the data for my scrollable menu as well as the associated audio.
draggableList.dataProvider = [
{id: "1", title: "Introduction", audio: "http://mydomain.com/00.mp3", description: "Introduction"},
{id: "2", title: "Chapter 1", audio: "http://mydomain.com/01qa.mp3", description: "Chapter 1"},
{id: "3", title: "Chapter 1", audio: "http://mydomain.com/01.mp3", description: "Practice"},
];
var o:Object = draggableList.selectedItem;
var sound:MP3Loader = new MP3Loader(o.audio, {name:"audio", autoPlay:true});
sound.load();
playPauseBtn.addEventListener(MouseEvent.CLICK, playPauseFunction);
closeBtn.addEventListener(MouseEvent.CLICK, closeFunction);
function playPauseFunction(event:MouseEvent):void {
sound.soundPaused = !sound.soundPaused;
}
function closeFunction(event:MouseEvent):void {
sound.dispose(true);
sound.unload();
trace("CLOSE");
}