views:

71

answers:

3

Doing some development in Flash Builder 4 using Action Script 3.0. I'm trying to have some code run each time the form is displayed. The form is not always recreated, but sometimes hidden and reused. Visual Basic used to have an Activate event that does similar to what I want.

I tried Render, but that fires every time the form changes (via click, text-edit, etc.)

We tried the FlexEvent.ADD, but it only fires when the form is first created, same as creation_complete.

Is there a good resource that shows the form "life cycle" and all the events and when they are fired and in what order?

TIA!

NOTE: I'm trying to get our forms to close when the ESC is pressed.

A: 

How about the UIComponent's activate event?

Robusto
Good tip! But I tried that and while it fires each time the form is activated, the current object is not getting focus.
peiklk
+1  A: 

How are you hiding & reusing the form? If you're just setting .visible, instead try actually adding & removing the form from the display list, I think that should trigger the ADD or ADDED_TO_STAGE events.

davr
A: 
modz0r