Quote:
Originally Posted by cheesecake
I am trying to find a way to make it so when a user click on a TabNavigator, it pops up into a larger version on the screen, then when its closed, it goes back to where it was (or stays there the whole time)
I am currently trying to do it with PopUp Manager, but what is happening, is the TabNavigator is not replaced, and is removed from the original spot.
How can i make this happen? or should I not be using PopUpManager all together?
private var _TabPopUp:TitleWindow;
private function createTabPopUp(_id:TabNavigator):void{
_TabPopUp = new TitleWindow();
_TabPopUp.addChild(_id);
_TabPopUp.showCloseButton = true;
_TabPopUp.addEventListener(CloseEvent.CLOSE, closePopUpCloseEvent);
PopUpManager.addPopUp(_TabPopUp,this,true);
PopUpManager.centerPopUp(_TabPopUp);
}
private function closePopUpCloseEvent(evt:CloseEvent):void{
PopUpManager.removePopUp(_TabPopUp);}
...
<mx:HBox id="_TabHBox" x="50" y="430" width="700" height="160">
<mx:TabNavigator id="_TabStructure" width="700" height="160"
click="createTabPopUp(_TabStructure)">
<mx:Canvas id="_TabCanvas1" label="Tab 1" width="100%" height="100%">
<mx:Text text="This is some info"/>
</mx:Canvas>
</mx:TabNavigator>
</mx:HBox
|
REPLY:
<mx:Script>
public function closePopUp(evt:CloseEvent):void{
T.height = 0;
T.width = 0;
parent_obj.addChild(target_obj);
popuplaunched=false;
PopUpManager.removePopUp(T);
}
private function browse(event:Event):void{
if(popuplaunched == false){
target_obj=(DisplayObject)(event.currentTarget);
/*------------------------------- */
parent_obj = target_obj.parent; //<<<<<< HERE
/*------------------------------- */
T = new TitleWindow();
T.height=Application.application.height;
T.width=Application.application.width;
T.addChild(target_obj);
T.showCloseButton = true;
T.addEventListener(CloseEvent.CLOSE,closePopUp);
PopUpManager.addPopUp(T,Application.application as
DisplayObject,true);
PopUpManager.centerPopUp(T);
popuplaunched = true;
}
}
</mx:Script>
Hi see this code , u need to concerntrate On ObjectDisplayContainer means parent of target Object. the same problem i were facing now resolve.
carry on >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>