0 Replies Latest reply on Dec 10, 2009 10:48 AM by CannotCompute

    Problems with CreationPolicy

    CannotCompute

      I have the creationPolicy set equal to 'none' on some panels.  Then I have a button that is on the same level as the panel.  If i comment out the button, then when i do createComponentsFromDescriptors(); the panel comes up just fine.  If the button is not commented out, then

      createComponentsFromDescriptors(); does nothing.  Can anyone explain this?

       

       

       

       

       

      works fine:

       

      <mx:Script> <![CDATA[

       

      import mx.controls.Alert;

      import effects.SpecialEffects;

      import mx.events.ResizeEvent;

       

      public function init():void

      {

      this.addEventListener(ResizeEvent.RESIZE, resizeHandler);

      view.createComponentsFromDescriptors();

      geh.createComponentsFromDescriptors();

       

      }

       

      private function resizeHandler(e:ResizeEvent):void

      {

      trace(e.type);

      }

       

      ]]>

      </mx:Script>

       

       

       

       

       

       

      <components:UI_Floorplan id="view" creationPolicy="none" />

      <components:UI_GlobalEventHandler id="geh" creationPolicy="none"/>

       

       

      <mx:HTTPService id="configData" url="fx.xml" fault="Alert.show('Error Loading XML');" result="fxdata=event.result.root.config; init();"/>

      <mx:ArrayCollection id="fxdata"/>

       

       

       

      <!--<mx:Button id="toggleBackend" width="4" height="4" right="0" bottom="0" click="geh.changeDisplay();"/>-->

       

       

      problems:

       

      <mx:Script> <![CDATA[

       

      import mx.controls.Alert;

      import effects.SpecialEffects;

      import mx.events.ResizeEvent;

       

       

      public function init():void

      {

      this.addEventListener(ResizeEvent.RESIZE, resizeHandler);

      view.createComponentsFromDescriptors();

      geh.createComponentsFromDescriptors();

       

      }

       

      private function resizeHandler(e:ResizeEvent):void

      {

      trace(e.type);

      }

       

      ]]>

      </mx:Script>

       

       

       

       

       

       

      <components:UI_Floorplan id="view" creationPolicy="none" />

      <components:UI_GlobalEventHandler id="geh" creationPolicy="none"/>

       

       

      <mx:HTTPService id="configData" url="fx.xml" fault="Alert.show('Error Loading XML');" result="fxdata=event.result.root.config; init();"/>

      <mx:ArrayCollection id="fxdata"/>

      <mx:Button id="toggleBackend" width="4" height="4" right="0" bottom="0" click="geh.changeDisplay();"/>