1 Reply Latest reply on Jun 26, 2007 9:28 PM by ricky grows

    AS3 Loader.content Access to Partially Loaded Content

    ricky grows
      I have a main swf that loads an external swf. The external swf is a fairly large video embeded on the timeline.

      Ive got my Loader all setup correctly, handling PROGRESS, COMPLETE and INIT events all fine.

      What id like to do (which i could do in AS2 very easily) is start the playing and accessing variables in the loaded swf before it finishes loading. If i do these things when the video swf is loaded completely, everything works fine.

      Any attempt to access Loader.content or the container clip ive placed Loader.content in, BEFORE its finished loading (when it reachs, lets say, 20%), i get error:

      #2099 The loading object is not sufficiently loaded to provide this information.

      Anyone have any ideas on how it could be possible to start messing with loaded SWF content before all of its frames are loaded? Thanks in advance for lookin over my post!!

        • 1. Re: AS3 Loader.content Access to Partially Loaded Content
          ricky grows Level 1
          Found an answer.

          So the trick is the INIT event fired by the Loader.contentLoaderInfo class.

          From what i've read, the INIT event fires as soon as you are able to start manipulating the loaded swf. In my example above, this event fires before the video is even 1% loaded; and once fired, i have access to it inside my init handler via the event argument passed by INIT (i.e. event.target.content).

          A side-note that im not to clear on...INIT is supposed to fire when all the classes in the sub-swf are loaded and available...well what happens if you import a package on the last frame of a 4000 frame movie? Seems to me you'd still have to wait.

          anyway, short of it...INIT fires when you can start using the movie...regardless of whether its loaded or not.