0 Replies Latest reply on Dec 4, 2008 10:15 AM by clsimeone

    Problem w/loaderInfo.loader. INIT event not dispatched. 

    clsimeone
      I have a Flash app made up of AS3 components that I am trying to run in Flex.

      In Flash, after the main component is added to the stage, the loader object (loaderInfo.loader) is null which is fine and I handle that.

      The same exact code in Flex has different results. On the applicationComplete event I add the the main component to the stage and the loader object's getter throws an exception - Error #2099: The loading object is not sufficiently loaded to provide this information.

      Also, the INIT event, which is supposed to be dispatched when the properties and methods of a loaded SWF file are accessible, does not appear to be firing which is probably part of the problem. But I can't figure out why it is not being dispatched.

      My code snippet of what happens when the object is instantiated is below.

      This line of code in the function checkLoaderInfo(...) throws the exception:
      if (this.loaderInfo.loader == null)

      The exception is caught in handleAddedToStage(...) which adds handlers as follows...
      this.loaderInfo.addEventListener(Event.COMPLETE, checkLoaderInfo);
      this.loaderInfo.addEventListener(Event.INIT, checkLoaderInfo);

      The events are never dispatched and the Flex app just does nothing after that.
      I just get that nice blue flex background...