[flexcoders] Re: TitleWindow Popup Question(s)
Glad I could help. Popups are actually children of the system manager not the application. :) So make sure you are listening in the right spot. --- In flexcoders@yahoogroups.com, Angelo Anolin wrote: > > hi Vito, > > Thanks a lot. This surely does work. The reason why my initialize events were > not firing is that I declared the popup window in an application scope > variable, so basically, it has alread been instantiated and not > re-instantiated when I make the call. > > Another question though. > > I think the TitleWindow when it is a popup window does not seem to be able to > make web service calls. I wonder why. After changing all the codes, I am > trying to retrieve a data from a web service from this popup TitleWindow but > nothing seems to happen. > > Suggestions highly appreciated. Thanks. > > > > > > > From: cuttenv > To: flexcoders@yahoogroups.com > Sent: Tuesday, 29 September, 2009 17:27:01 > Subject: [flexcoders] Re: TitleWindow Popup Question(s) > > > Hey there, > I'm not sure how you are creating your popup but I would recommend you do it > like this. > var popper:TestPopUp = new TestPopUp(); > PopUpManager. addPopUp( popper,this) ; > PopUpManager. centerPopUp( popper); > > Where TestPopUp is your TitleWindow Component. Then your creationComplete and > Initialize events will fire every time because you are creating a new > reference. > > You can reference the title of the title window inside it's self by calling > this.title. > > //This code would go inside the TestPopUp.mxml which extends TitleWindow in > my example > > private function getTitleWindowTitle () :void > > { > > Alert.show(this. title); > > // I Should be able to display the Title of the title window in an alert > > message. > > } > > Hope that helps, > -Vito > > --- In flexcod...@yahoogro ups.com, Angelo Anolin wrote: > > > > Hi FlexCoders, > > > > Just a little TitleWindow popup question. > > > > I want a function to be executed everytime my popup title window component > > is displayed. How do I achieve this? > > > > I tried in the title window using the initialize property like: > > http://www.adobe. com/2006/ mxml" initialize=" > > RunEveryPop( );" > > > > > but my function RunEveryPop only executes the first time the popup is > > displayed. Subsequent popups would not trigger the said function. > > > > I know I can declare a public function in the title window and simply call > > this function from the calling main application, but I am wondering if this > > is a good or recommended way in achieving this? > > > > Also, another question... > > > > How do I reference the title of the TitleWindow from within itself? Like > > for example: > > > > private function getTitleWindowTitle () :void > > { > > Alert.show(Titlewin dow.Title) ; > > // I Should be able to display the Title of the title window in an alert > > message. > > } > > > > Advice and inputs would be highly appreciated. > > > > Thanks., > > >
Re: [flexcoders] Re: TitleWindow Popup Question(s)
hi Vito, Thanks a lot. This surely does work. The reason why my initialize events were not firing is that I declared the popup window in an application scope variable, so basically, it has alread been instantiated and not re-instantiated when I make the call. Another question though. I think the TitleWindow when it is a popup window does not seem to be able to make web service calls. I wonder why. After changing all the codes, I am trying to retrieve a data from a web service from this popup TitleWindow but nothing seems to happen. Suggestions highly appreciated. Thanks. From: cuttenv To: flexcoders@yahoogroups.com Sent: Tuesday, 29 September, 2009 17:27:01 Subject: [flexcoders] Re: TitleWindow Popup Question(s) Hey there, I'm not sure how you are creating your popup but I would recommend you do it like this. var popper:TestPopUp = new TestPopUp(); PopUpManager. addPopUp( popper,this) ; PopUpManager. centerPopUp( popper); Where TestPopUp is your TitleWindow Component. Then your creationComplete and Initialize events will fire every time because you are creating a new reference. You can reference the title of the title window inside it's self by calling this.title. //This code would go inside the TestPopUp.mxml which extends TitleWindow in my example > private function getTitleWindowTitle () :void > { > Alert.show(this. title); > // I Should be able to display the Title of the title window in an alert > message. > } Hope that helps, -Vito --- In flexcod...@yahoogro ups.com, Angelo Anolin wrote: > > Hi FlexCoders, > > Just a little TitleWindow popup question. > > I want a function to be executed everytime my popup title window component is > displayed. How do I achieve this? > > I tried in the title window using the initialize property like: > http://www.adobe. com/2006/ mxml" initialize=" > RunEveryPop( );" > > > but my function RunEveryPop only executes the first time the popup is > displayed. Subsequent popups would not trigger the said function. > > I know I can declare a public function in the title window and simply call > this function from the calling main application, but I am wondering if this > is a good or recommended way in achieving this? > > Also, another question... > > How do I reference the title of the TitleWindow from within itself? Like for > example: > > private function getTitleWindowTitle () :void > { > Alert.show(Titlewin dow.Title) ; > // I Should be able to display the Title of the title window in an alert > message. > } > > Advice and inputs would be highly appreciated. > > Thanks., >
[flexcoders] Re: TitleWindow Popup Question(s)
Hey there, I'm not sure how you are creating your popup but I would recommend you do it like this. var popper:TestPopUp = new TestPopUp(); PopUpManager.addPopUp(popper,this); PopUpManager.centerPopUp(popper); Where TestPopUp is your TitleWindow Component. Then your creationComplete and Initialize events will fire every time because you are creating a new reference. You can reference the title of the title window inside it's self by calling this.title. //This code would go inside the TestPopUp.mxml which extends TitleWindow in my example > private function getTitleWindowTitle() :void > { > Alert.show(this.title); > // I Should be able to display the Title of the title window in an alert > message. > } Hope that helps, -Vito --- In flexcoders@yahoogroups.com, Angelo Anolin wrote: > > Hi FlexCoders, > > Just a little TitleWindow popup question. > > I want a function to be executed everytime my popup title window component is > displayed. How do I achieve this? > > I tried in the title window using the initialize property like: > http://www.adobe.com/2006/mxml"; > initialize="RunEveryPop();" > > > but my function RunEveryPop only executes the first time the popup is > displayed. Subsequent popups would not trigger the said function. > > I know I can declare a public function in the title window and simply call > this function from the calling main application, but I am wondering if this > is a good or recommended way in achieving this? > > Also, another question... > > How do I reference the title of the TitleWindow from within itself? Like for > example: > > private function getTitleWindowTitle() :void > { > Alert.show(Titlewindow.Title); > // I Should be able to display the Title of the title window in an alert > message. > } > > Advice and inputs would be highly appreciated. > > Thanks., >