So I used the demo code and was trying to load in mp3 sounds and then get the MP3Loader class to have access to the volume, etc. The problem was that it gave an error stating that it can't convert the object to that type. If I change the 'snd1' variable in the completeHandler to be of type 'Sound' then it works fine (well..after I put snd1.play() on the next line). Am I not doing this correctly?
var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});
//append several loaders
queue.append( new MP3Loader("mp3/audio.mp3", {name:"audio", repeat:2, autoPlay:true}) );
//start loading
queue.load();
function progressHandler(event:LoaderEvent):void {
trace("progress: " + event.target.progress);
}
function completeHandler(event:LoaderEvent):void {
var snd1:MP3Loader = LoaderMax.getContent("audio");
trace(event.target + " is complete!");
}
function errorHandler(event:LoaderEvent):void {
trace("error occured with " + event.target + ": " + event.text);
}