RE: [flexcoders] Re: how to close a titlewindow that was not created as a popup

2009-03-09 Thread Ryan Graham

Post some code and we'll take it from there...

 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stinasius
Sent: Friday, March 06, 2009 10:50 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: how to close a titlewindow that was not
created as a popup

 

am calling it from with the titlewindow i would like to close. i also
tried calling it from the parent page that calls the custom titlewindow.





This message is private and confidential. If you have received it in error, 
please notify the sender and remove it from your system.

[flexcoders] Re: how to close a titlewindow that was not created as a popup

2009-03-09 Thread stinasius
this is my code

import mx.containers.TitleWindow;

 private function closeWindow(event:Event):void{
removeChild( event.target as TitleWindow);
currentState='';
} 


then on the titlewindow component this is the way i call the close function

mx:State name=login_reg
mx:RemoveChild target={intro}/
mx:AddChild relativeTo={intro_container}
mx:target 
comp:login_register id=login_reg 
close=closeWindow(event) loginSuccessful=handleLoginSucess(event)/
/mx:target
/mx:AddChild  
/mx:State



RE: [flexcoders] Re: how to close a titlewindow that was not created as a popup

2009-03-06 Thread Ryan Graham

Sure:

 

?xml version=1.0 encoding=utf-8?

mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute

  mx:Script

![CDATA[

  import mx.containers.TitleWindow;

  private function onClose(event:Event):void

  {

removeChild(event.target as TitleWindow);

  }

]]

  /mx:Script

  mx:TitleWindow showCloseButton=true close=onClose(event)/

/mx:Application

 

HTH,

Ryan

 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stinasius
Sent: Thursday, March 05, 2009 10:08 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: how to close a titlewindow that was not
created as a popup

 

care to share how?





This message is private and confidential. If you have received it in error, 
please notify the sender and remove it from your system.

[flexcoders] Re: how to close a titlewindow that was not created as a popup

2009-03-06 Thread stinasius
i am getting this error when i apply your code.

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the 
caller.
at flash.display::DisplayObjectContainer/removeChild()
at mx.core::Container/removeChild()
at custom_comps::login_register/closeWindow()
at custom_comps::login_register/___TitleWindow1_close()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.containers::Panel/closeButton_clickHandler()




[flexcoders] Re: how to close a titlewindow that was not created as a popup

2009-03-06 Thread stinasius
am calling it from with the titlewindow i would like to close. i also tried 
calling it from the parent page that calls the custom titlewindow.



[flexcoders] Re: how to close a titlewindow that was not created as a popup

2009-03-05 Thread stinasius
care to share how?