As you can see here there is no data property on the event class
. So you either need cretate you own custom data event or use the DynamicEvent
class. I would go for the first one.
I need to re-implement the same function (within my app) so that I can handle the same state changes.
That means that given the event data object, I need to figure out the new "state".
Thanks for replying.
But I am totally confused because ... Is that private function not getting "event:Event" as input and is it not reading "event["data"] ? ... Furthermore, at the end of the function, is it not dispatching an event - where it's sending an event object and which my subscribing routine would receive and consume - just like this private function did ?
The content is of type DisplayObject but on runtime is loaded a subclass of
DisplayObject. That object is dispatching onStateChange, is probably a custom
event with data property inside. However the handler is registered with the
generic Event class which works since the custom event extends the base Event
class. Your guy is avoiding the compile time error by doing the array type
syntax event["data"] instead of the object one event.data. I am not sure what
kind of event is your content dispatching but it sholud be one with a data
property inside, because the one you use now obviously doesn't have it. Hence
the error only at runtime and not compile time.