IMO, there is no one right answer. Usually, these MXML components are heavy and slow and the UI freezes during instantiation. The point of states is to retain these initialized components and only flip a few properties in it when re-using it. That's a reason we recycle item renderers as well.
However, there is a cost to trying to "revert" an instance back to some "safe" set of properties since that also takes time plus you sometimes forget to undo something, so it might just be easier to toss them and create new ones. That said, using Model/View, MVC or other patterns where the View operates on a separable data model is my recommendation. Usually it is the instantiation of the UI widgets that is so costly, so you can re-use the View, but just assign it a different model instance. HTH, -Alex On 7/25/16, 10:33 AM, "bilbosax" <[email protected]> wrote: >Thank you Alex. I have followed you in the Flex development world >starting >back in 2009 when it first came up on my radar screen so I know how much >you >understand all of this material and am grateful for all of your input. >Since I just dabble in this, I am curious as to what you think is the >proper >way to handle this situation. Do you think it is better to close out the >component, and then to recreate it each time I need it? Or do you feel it >is better to just listen for a state change to reset all of the value in >my >component, and to just keep the one component and use it over and over? > > > >-- >View this message in context: >http://apache-flex-users.2333346.n4.nabble.com/Question-about-Components-G >arbage-Collection-an-CreationComplete-tp13041p13059.html >Sent from the Apache Flex Users mailing list archive at Nabble.com.
