> Why can't i just call removeEventListener in ActionScript on the type
of event declared in MXML?

 

Because you don't know what to pass for the handler reference. When you
write MXML code like

 

<Button click="a=1; b=2"/>

 

the MXML compiler autogenerates an event handler method whose body
containts the statements in the attribute value, and you don't have
access to this method.

 

Gordon Smith

Adobe Flex SDK Team

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of florian.salihovic
Sent: Monday, July 21, 2008 1:20 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Inline EventListener in MXML tags - confusing
description in Developers guide.

 

Quoted from Adobe Flex Developers Guide, page 78

"However, it is best practice to use the addEventListener() method.
This method gives you greater control over the event by letting
you configure the priority and capturing settings, and use event
constants.
In addition, if you use addEventListener() to add an event handler, you
can
use removeEventListener() to remove the handler when you no longer need
it. If you add an event handler inline, you cannot call
removeEventListener()
on that handler."

- End of Quote -

What i think is a little bit confusing is, that it's said that inline
EventListener can't be 
removed? Or is it just a little bit unluckily expressed? Why can't i
just call 
removeEventListener in ActionScript on the type of event declared in
MXML?

Best regards from Germany

 

Reply via email to