[flexcoders] Can a 'child' tell when its parents view state changed?
I have a set of viewstates that are used many times. When the view state is changed, I would like the child to reset its view. I would like the child to know when it is revealed due to the state change of the parent. It seems that the child does not know when the parent changes view states at all so the only way I could do this would be to 1) Have the controller that changes states reset the child 2) Have the child register for the viewstate ENTER_STATE event on its parent I've tried capturing hide/show/render on the child, but none of those fit What does flex actually do to children when they are no visible due to a remove child in a state, I would have assumed that they would be hidden but that doesn't seem to be the case and digging through the viewstate and addchild code of the sdk its not obvious to me what a state change really does under the covers to hide or reveal a set of children. ... b l u e t u b e i n t e r a c t i v e. .: Development solutions for creatives :. .: grant davies .: 404.428.6839 (c) .: 404.921.9550 (F) [EMAIL PROTECTED] http://www.bluetube.com/bti http://www.bluetube.com/bti image001.jpg
Re: [flexcoders] Can a 'child' tell when its parents view state changed?
have you tried the added/removed events? usually hiding/showing children in viewstates using the design mode entail adding/removing the corresponding children rather than just hiding or setting the visibilities unless you explicitly set them to be so in the source view.--- On Sun, 5/25/08, Grant Davies [EMAIL PROTECTED] wrote:From: Grant Davies [EMAIL PROTECTED]Subject: [flexcoders] Can a 'child' tell when its parents view state changed?To: flexcoders@yahoogroups.comDate: Sunday, May 25, 2008, 1:22 AMI have a set of viewstates that are used many times. When the view state is changed, I would like the child to “reset” its view. I would like the child to know when it is “revealed” due to the state change of the parent. It seems that the child does not know when the parent changes view states at all so the only way I could do this would be to 1) Have the controller that changes states reset the child2) Have the child register for the viewstate ENTER_STATE event on its parent I’ve tried capturing hide/show/render on the child, but none of those “fit” What does flex actually do to children when they are no visible due to a “remove child” in a state, I would have assumed that they would be hidden but that doesn’t seem to be the case and digging through the viewstate and addchild code of the sdk its not obvious to me what a state change really does under the covers to hide or reveal a set of children. . . . › b l u e t u b e i n t e r a c t i v e..: Development solutions for creatives :..: grant davies.: 404.428.6839 (c).: 404.921.9550 (F)› [EMAIL PROTECTED] comhttp://www.bluetube .com/bti
RE: [flexcoders] Can a 'child' tell when its parents view state changed?
Thanks for the idea leds, The added event is fired when the child is first added (same time as creationComplete is fired), but when the child is made visible due to a state change by the parent the added is not fired again on the child. Cheers, Grant ... b l u e t u b e i n t e r a c t i v e. .: Development solutions for creatives :. .: grant davies .: 404.428.6839 (c) .: 404.921.9550 (F) [EMAIL PROTECTED] http://www.bluetube.com/bti http://www.bluetube.com/bti From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of leds usop Sent: Saturday, May 24, 2008 2:09 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Can a 'child' tell when its parents view state changed? have you tried the added/removed events? usually hiding/showing children in viewstates using the design mode entail adding/removing the corresponding children rather than just hiding or setting the visibilities unless you explicitly set them to be so in the source view. --- On Sun, 5/25/08, Grant Davies [EMAIL PROTECTED] wrote: From: Grant Davies [EMAIL PROTECTED] Subject: [flexcoders] Can a 'child' tell when its parents view state changed? To: flexcoders@yahoogroups.com Date: Sunday, May 25, 2008, 1:22 AM I have a set of viewstates that are used many times. When the view state is changed, I would like the child to reset its view. I would like the child to know when it is revealed due to the state change of the parent. It seems that the child does not know when the parent changes view states at all so the only way I could do this would be to 1) Have the controller that changes states reset the child 2) Have the child register for the viewstate ENTER_STATE event on its parent I've tried capturing hide/show/render on the child, but none of those fit What does flex actually do to children when they are no visible due to a remove child in a state, I would have assumed that they would be hidden but that doesn't seem to be the case and digging through the viewstate and addchild code of the sdk its not obvious to me what a state change really does under the covers to hide or reveal a set of children. . . . b l u e t u b e i n t e r a c t i v e. .: Development solutions for creatives :. .: grant davies .: 404.428.6839 (c) .: 404.921.9550 (F) [EMAIL PROTECTED] com http://www.bluetube .com/bti http://www.bluetube.com/bti image001.jpg
RE: [flexcoders] Can a 'child' tell when its parents view state changed?
A state change may create components, add them to the display list or show them if hidden. The corresponding events are creationComplete, addedToStage, and show. You may need to listen to all three From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Grant Davies Sent: Saturday, May 24, 2008 10:23 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Can a 'child' tell when its parents view state changed? I have a set of viewstates that are used many times. When the view state is changed, I would like the child to reset its view. I would like the child to know when it is revealed due to the state change of the parent. It seems that the child does not know when the parent changes view states at all so the only way I could do this would be to 1) Have the controller that changes states reset the child 2) Have the child register for the viewstate ENTER_STATE event on its parent I've tried capturing hide/show/render on the child, but none of those fit What does flex actually do to children when they are no visible due to a remove child in a state, I would have assumed that they would be hidden but that doesn't seem to be the case and digging through the viewstate and addchild code of the sdk its not obvious to me what a state change really does under the covers to hide or reveal a set of children. ... b l u e t u b e i n t e r a c t i v e. .: Development solutions for creatives :. .: grant davies .: 404.428.6839 (c) .: 404.921.9550 (F) [EMAIL PROTECTED] http://www.bluetube.com/bti http://www.bluetube.com/bti image001.jpg