Re: [flexcoders] What is the correct way to detect activation of a Canvas in a ViewStack?
Have you seen processDescriptors property? Check the docs for that one, maybe is what you are lookinf for 2007/3/24, Tim Walling [EMAIL PROTECTED]: You could try setting up a show event listener to trigger your initialization code. Something like this: mx:ViewStack mx:Canvas show=handleShowEvent()/ /mx:ViewStack Whenever the ViewStack makes the canvas the visible/active one, the show event would fire. or if your Canvas is an mxml component, it could handle the show event internally: mx:ViewStack view:MyCanvas/ /mx:ViewStack MyCanvas.mxml mx:Canvas show=handleShowEvent() mx:Script private function handleShowEvent(event:FlexEvent):void { // call initialize code } /mx:Script /mx:Canvas Then each of your components in the ViewStack would manage their respective show events. Tim On 23 Mar 2007 17:02:56 -0700, wdsnapper [EMAIL PROTECTED] wrote: I am using a ViewStack to contain a set of Canvas'. I switch between items in the stack by clicking on buttons. I want to be able to detect when a Canvas gains focus and run a method to initialize content on that Canvas. What is the correct event to monitor to achieve this behavior? Thanks in advance. -- Tim timwalling.com -- ::| Carlos Rovira ::| http://www.carlosrovira.com ::| http://www.madeinflex.com
Re: [flexcoders] What is the correct way to detect activation of a Canvas in a ViewStack?
You could try setting up a show event listener to trigger your initialization code. Something like this: mx:ViewStack mx:Canvas show=handleShowEvent()/ /mx:ViewStack Whenever the ViewStack makes the canvas the visible/active one, the show event would fire. or if your Canvas is an mxml component, it could handle the show event internally: mx:ViewStack view:MyCanvas/ /mx:ViewStack MyCanvas.mxml mx:Canvas show=handleShowEvent() mx:Script private function handleShowEvent(event:FlexEvent):void { // call initialize code } /mx:Script /mx:Canvas Then each of your components in the ViewStack would manage their respective show events. Tim On 23 Mar 2007 17:02:56 -0700, wdsnapper [EMAIL PROTECTED] wrote: I am using a ViewStack to contain a set of Canvas'. I switch between items in the stack by clicking on buttons. I want to be able to detect when a Canvas gains focus and run a method to initialize content on that Canvas. What is the correct event to monitor to achieve this behavior? Thanks in advance. -- Tim timwalling.com
[flexcoders] What is the correct way to detect activation of a Canvas in a ViewStack?
I am using a ViewStack to contain a set of Canvas'. I switch between items in the stack by clicking on buttons. I want to be able to detect when a Canvas gains focus and run a method to initialize content on that Canvas. What is the correct event to monitor to achieve this behavior? Thanks in advance.