2 Replies Latest reply on Feb 26, 2007 2:38 PM by Newsgroup_User

    ModuleLoader - Weird errors happening

    Level 7
      Hi,

      I'm trying to build a modular application. I'm experiencing really weird
      stuff when I use combo boxes inside modules and load them through the module
      loader (basically, when you load one, then another at the same spot). I just
      did a little sample app to experience with it and compile the modules
      without using any kind of link report etc... Anyhow here is my code, and if
      somebody wants me to put it up online or zip it up, just let me know....

      Thanks!

      index.mxml:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical">

      <mx:ModuleLoader id="myModule" url="module1.swf" />
      <mx:Button label="module 1" click="{myModule.url = 'module1.swf'}" />
      <mx:Button label="module 2" click="{myModule.url = 'module2.swf'}" />
      </mx:Application>


      module1.mxml & module2.mxml:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Module xmlns:mx=" http://www.adobe.com/2006/mxml" width="800"
      height="600">
      <mx:ComboBox>
      <mx:ArrayCollection>
      <mx:String>AK</mx:String>
      <mx:String>AL</mx:String>
      <mx:String>AR</mx:String>
      </mx:ArrayCollection>
      </mx:ComboBox>
      </mx:Module>




        • 1. Re: ModuleLoader - Weird errors happening
          Level 7
          Forgot to copy the error I get on my real app':

          TypeError: Error #1009: Cannot access a property or method of a null object
          reference.
          at mx.managers::DragManager$/get isDragging()
          at
          mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::dragScroll()
          at Function/ http://adobe.com/AS3/2006/builtin::apply()
          at ()
          at flash.utils::SetIntervalTimer/flash.utils:SetIntervalTimer::onTimer()
          at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
          at flash.utils::Timer/flash.utils:Timer::tick()


          • 2. Re: ModuleLoader - Weird errors happening
            Level 7
            Well I guess I'm kind of helping myself :-)

            Googled it. Read:
            http://blog.kevinhammer.net/
            "Component errors when using modules

            So I've been creating a new site using Flex 2.0.1 and I've been using a lot
            of modules in my design. However, when I added a COmboBox control to a
            module, I started getting an error from some internal Flex Singleton Class
            saying that some classes needed hadn't been loaded.

            Well, I have my modules and my app setup using the new load-externs option
            and thought that all the classess needed would be in my app swf. Apparently
            not exactly... so all I did was in my root application I made a class that
            has var of all the types of components I want to use in my modules. That
            increased the size of my app swf file, which indicates to me that indeed,
            some classes I needed in modules weren't in my app.

            Recompile and run... and it works!"


            For my specific project I just included a <mx:ComboBox visible="false"/>.
            It's not clean but it will save me a few hours...

            JG