Jump to content
Search Community

stompwampa

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by stompwampa

  1. What I meant was that is it necessary to create a LoaderMax on my sub-loaded swf to load my XMLLoader if my XMLLoader in turn has a LoaderMax node followed by several ImageLoader nodes? Or can I just skip the first LoaderMax on Frame 1 and just use an XMLLoader and it's subsequent LoaderMax/ImageLoaders?

  2. In regards to my original post...does it matter if the SWF file I am subloading uses a LoaderMax which inturn loads an XMLLoader or if I just skip the LoaderMax and create an XMLLoader right onto the stage and use that? (in terms of estimatedBytes being sent back to the LOADER swf file)

  3. Yep. The LoaderMax is in the first frame of my movie.

     

    this.root traces out to Object MainTimline.

     

    I am NOT loading across a subdomain. Same directory actually.

     

    Just upgraded to the latest version.

     

    Still have the same issue. I guess it's not really THAT big of a deal...just kinda annoying for the user to see the progress bar shoot up to 100% and then start over again when the subloader starts it's load.

  4. I'm having a hard time getting loading progress to interate together.

     

    In my LOADER swf, I have a SWFLoader that is loading my main movie.

     

    Inside my main movie, I have a LoaderMax instance which loads a single XMLLoader (which subsequently creates a bunch of ImageLoaders).

     

    Anyways...I've got it so that my main movie doesn't actually start until all loading is complete (which is good). But my LOADER swf first loads the main movie (and show's it's progress) then it starts the progress over back at 0 and shows the subloading of the LoaderMax/XMLLoader inside.

     

    I want it all to work together as one big load...what am I missing?

     

    Here is the code in my Loader file:

     

    import com.greensock.loading.LoaderMax;
    import com.greensock.loading.SWFLoader;
    import com.greensock.events.LoaderEvent;
    
    var loader:SWFLoader = new SWFLoader("MyMovie.swf",{name:"MyMovie",container:this,x:0,y:0,onComplete:onCompleteHandler,onProgress:onProgressHander,onError:onErrorHandler});
    
    loader.load();
    
    function onProgressHander(Event:LoaderEvent):void {
    
    loading_txt.text = "Loading " + String(Math.ceil(Event.target.progress * 100)) + "%";
    }
    
    function onCompleteHandler(Event:LoaderEvent):void {
    
    //addChild(loader.getContent("MyMovie"));
    }
    
    function onErrorHandler(Event:LoaderEvent):void {
    
    loading_txt.text = "Error Loading Data.";
    }
    

     

    And here is the loading code in my main movie:

     

    LoaderMax.activate([imageLoader]);
    
    var xmlLoader:XMLLoader = new XMLLoader("xml/images.xml",name:"xmlLoader",onProgress:progressHandler,onComplete:completeHandler,onError:errorHandler});
    
    var q:LoaderMax = new LoaderMax({name:"mainLoader",autoLoad:true,requireWithRoot:this.root});
    
    q.append(xmlLoader);
    
    

  5. Oh, duh. That makes sense now.

     

    This is my first time trying LoaderMax. I converted an old loader to LoaderMax. I see what I missed now.

     

    Now, here's the new problem I'm having:

     

    When I test my movie, this is the error that outputs:

     

    loaded

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at warrior_fla::MainTimeline/updateText()

    at flash.events::EventDispatcher/dispatchEventFunction()

    at flash.events::EventDispatcher/dispatchEvent()

    at com.greensock.loading::SWFLoader/_progressHandler()

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at warrior_fla::MainTimeline/updateText()

    at flash.events::EventDispatcher/dispatchEventFunction()

    at flash.events::EventDispatcher/dispatchEvent()

    at com.greensock.loading::SWFLoader/_progressHandler()

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at warrior_fla::MainTimeline/updateText()

    at flash.events::EventDispatcher/dispatchEventFunction()

    at flash.events::EventDispatcher/dispatchEvent()

    at com.greensock.loading::SWFLoader/_progressHandler()

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at warrior_fla::MainTimeline/updateText()

    at flash.events::EventDispatcher/dispatchEventFunction()

    at flash.events::EventDispatcher/dispatchEvent()

    at com.greensock.loading::SWFLoader/_progressHandler()

     

    And this just cycles over and over again. It traces out 'loaded' and then throws that error as the update even trys to happen and then traces out 'loaded' again. Looks like it keeps trying to load the movie over and over and over again.

     

    This only happens when loading this particular movie. If I true to load a different movie from my website, it works just fine. Not sure what's going on here.

  6. This is the error I'm getting when I test my movie:

     

    TypeError: Error #1034: Type Coercion failed: cannot convert com.greensock.events::LoaderEvent@24b69f21 to flash.events.ProgressEvent.

    at flash.events::EventDispatcher/dispatchEventFunction()

    at flash.events::EventDispatcher/dispatchEvent()

    at com.greensock.loading::SWFLoader/_progressHandler()

     

    And here is my loading code:

     

    import com.greensock.events.*;
    import com.greensock.loading.*;
    
    stop();
    
    var loader:SWFLoader = new SWFLoader("mySwf.swf",{container:this,x:0,y:0,onProgress:updateText,onInit:addContent,autoDispose:true});
    
    loader.load();
    
    var l:Number;
    var t:Number;
    var p:Number;	
    
    function updateText(event:ProgressEvent):void
    {
    l = loader.bytesLoaded;
    t = loader.bytesTotal;
    p = Math.ceil((l/t)*100);
    
    loader_mc.loader_txt.text = "Loading: " + String(p) + " %";
    }
    
    function addContent(event:Event):void
    {
    
    trace("loaded");
    
    }
    

     

    Not sure why this is happening...any ideas?

×
×
  • Create New...