Jump to content
Search Community

next2heaven

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by next2heaven

  1. On other question. I'm now working with swf files. I've added:

     

    queue.append( new MP3Loader("swf/ani1.swf", {name:"swfAni1", container:this, autoPlay:true}) );

     

    So in the complete event function how would I get the SWFLoader object back? I've tried a number of combinations but I either get errors or no errors but nothing displays. I thought it would addChild automatically? (when I addChild it fails). Here is how I thought it would work:

     

    var ani_1:SWFLoader = LoaderMax.getLoader("swfAni1");
    // Then I could use ani_1 with all it's properties...should already be added to the screen..etc.

     

    Apparently I'm wrong in my assumption. What am I missing?

  2. 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);
    }
    

×
×
  • Create New...