1 Reply Latest reply on Feb 8, 2010 10:58 PM by m_puns

    Unloading modules using Parsley and the Cairngorm 3 Module Library

    Karl_Sigiscar_1971 Level 3

      Hello,


      We are using Parsley and Cairngorm 3 to declare and load modules in our Flex application.


      Currently, the link [How to use the Cairngorm Module library] of the Module Library - beta section is empty.
      http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm+Libraries#CairngormLibraries- Module


      We have been able to figure out a lot of things with the sample A Modular Sample Application Explained:

      http://opensource.adobe.com/wiki/display/cairngorm/ModularSampleApplicationExplained


      However, the topic of unloading modules is not covered.

       

      The only hints I got so far are from the SVN source of the library:

       

      http://opensource.adobe.com/svn/opensource/cairngorm3/trunk/libraries/Module/src/com/adobe /cairngorm/module/IUnloadPolicy.as

       

      http://opensource.adobe.com/svn/opensource/cairngorm3/tags/cairngorm-3.0.2/libraries/Modul e/src/com/adobe/cairngorm/module/ViewLoader.as


      Could someone explain what are the instructions in the API to unload modules and dispose of their corresponding context ?


      Here is a sample of the code we are using:


      <?xml version="1.0" encoding="utf-8"?>
      <module:ViewLoader xmlns:module="com.adobe.cairngorm.module.*"
                         xmlns:mx="http://www.adobe.com/2006/mxml"
                         progress="message = 'Loading: ' + event.bytesLoaded + ' of ' + event.bytesTotal"
                         error="message = event.errorText"
                         horizontalAlign="center"
                         verticalAlign="middle"
                         addedToStage="dispatchEvent( new Event( 'configureIOC', true ) )">

       

          <mx:Script>
              <![CDATA[
                  [Bindable]
                  public var message:String;
              ]]>
          </mx:Script>


          <module:progressView>
              <mx:Label text="{ message }"/>
          </module:progressView>
          <module:errorView>
              <mx:Label color="0xFF0000"
                        text="{ message }"/>
          </module:errorView>
      </module:ViewLoader>

       

      Best  regards,
      Karl Sigiscar.