开发者

Flex Flash Action Script Form Events

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 trie开发者_运维问答d 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.


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.


How about the UIComponent's activate event?


Instead of using AS's events and commands, create few of your own.
What I mean is, instead of calling object.visable = true, make a function that does 2 things:

  • object.visable = true
  • Dispatch a custom event named "ActivateLikeEvent"

This way you'll have your activate event.


You could also try show or addedToStage

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜