Check out this presentation:
http://www.ananth.info/files/54923-48191/FlexEventDataManagement10April2007.ppt

slide 10
* Every object in the display list can trace its class inheritance to
DisplayObject class
* The DisplayObject class inherits from EventDispatcher
* EventDispatcher is the base class that provides core event model
functionality for every object on the display list
* Because DisplayObject inherits from EventDispatcher, every component
on the display list will have access to properties and methods of
event model (defined in EventDispatcher)

Actionscript classes don't inherit from EventDispatcher unless they
explicitly extend a DisplayObject

Three approaches:
* Have your actionscript class inherit from a display object
* Have your actionscript class implement IEventDispatcher
(http://livedocs.adobe.com/flex/2/langref/flash/events/IEventDispatcher.html)
* In the object you want to listen to, add a new property that you
instantiate as a dispatcher object. Listen to that dispatcher object
(img.dispatcher.addEventListener -- you will need to add more than
this). This solution is handy in some scenario but doesn't seem any
practical for listening to a built-in Flex Image object. 


> I got the following error:
> "TypeError: Error #1006: addEventListener is not a function."
> 
> Any lead? Thanks.
>


Reply via email to