2 Replies Latest reply on Oct 1, 2009 12:51 AM by nikos101

    My first play with modules

    nikos101 Level 2

      I have a module that I want to load into a canvas in a viewstack and give it an id.

       

      private var suggestion:SuggestionModule;

       

       

      When the function renderSuggestionModule is called, if I remove suggestion from my viewstack is it removed from memory?

       

      private function loadSuggestionModule():void

      {

      moduleInfo = ModuleManager.getModule("SuggestionModule.swf");

      moduleInfo.addEventListener(ModuleEvent.READY, renderSuggestionModule);

      moduleInfo.addEventListener(ModuleEvent.ERROR, handleError);

      moduleInfo.addEventListener(ModuleEvent.PROGRESS, showProgress);

      moduleInfo.load();

      suggestionProgress.visible = true;

      }

       

      private function renderSuggestionModule(event:ModuleEvent):void

      {

      suggestion = moduleInfo.factory.create() as SuggestionModule;

      suggestion.setHeaderMessage("Suggestion - Home Page");

      PopUpManager.addPopUp(suggestion, this, true);

      PopUpManager.centerPopUp(suggestion);

      suggestionProgress.visible = false;

      }