Mega Code Archive

 
Categories / Flex / Data Model
 

Save Popup into Array and reference it later

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">     <mx:HBox width="600" height="500" creationComplete="addDialog()">         <mx:Script>                              import mx.managers.PopUpManagerChildList;                 import mx.controls.LinkButton;                 import mx.containers.Panel;                 import mx.managers.PopUpManager;                      public var popUpArray:Array = new Array();                      private function addDialog():void                 {                     var pop:Panel = (PopUpManager.createPopUp(this, mx.containers.Panel,false, PopUpManagerChildList.POPUP) as Panel);                     pop.title = "A";                     pop.y = 100;                     popUpArray.push(pop);                     pop = (PopUpManager.createPopUp(this, mx.containers.Panel, false,PopUpManagerChildList.POPUP) as Panel);                     pop.title = "B";                     pop.y = 200;                     popUpArray.push(pop);                     pop = (PopUpManager.createPopUp(this, mx.containers.Panel, false, PopUpManagerChildList.POPUP) as Panel);                     pop.title = "C";                     pop.y = 300;                     popUpArray.push(pop);                     var link:LinkButton = new LinkButton();                     link.label = "Hello";                     (popUpArray[1] as Panel).addChild(link);                 }                              </mx:Script>     </mx:HBox> </mx:Application>