Adobe Flex Actionscript Question:
Download Questions PDF

What does calling preventDefault() on an event do? How is this enforced?

Answer:

Cancels an event's default behavior if that behavior can be canceled.. For example, the doubleClick event has an associated default behavior that highlights the word under the mouse pointer at the time of the event. Your event listener can cancel this behavior by calling the preventDefault() method.
You can use the Event.cancelable property to check whether you can prevent the default behavior associated with a particular event. If the value of Event.cancelable is true, then preventDefault() can be used to cancel the event; otherwise, preventDefault() has no effect.

Download Adobe Flex Actionscript Interview Questions And Answers PDF

Previous QuestionNext Question
How do you add event listeners in mxml components. Now AS3 components?What is the problem with calling setStyle()