Friday, March 26, 2010

How to resume event after prevented...

Let's say I have an event handler that captures an event and I call preventDefault() if the event.target is a certain component. preventDefault() is called on that component because we want to present a user with a confirmation dialog box (i.e., ''Do you want to delete this item?''). If they then click YES, it continues on with the original event handler's actions. If they click NO, we don't do anything.

The closest example I could find was this http://www.darronschall.com/weblog/2008/01/creating-default-cancelable-event-han dlers.cfm and just can't make any sense of it.

How to resume event after prevented...

The event flow is not designed for pause and resume.

One way to do this if you're dispatching your own event is to re-dispatch the event with cancelable=false if you want to resume.

Alex Harui

Flex SDK Developer

Adobe Systems Inc.

Blog: http://blogs.adobe.com/aharui

No comments:

Post a Comment