In the flash.events.Event
class, the currentTarget
property is typed as Object
, which is dynamic. In the starling.events.Event
class, the currentTarget
property is typed as EventDispatcher
, which is not dynamic. When an object is dynamic, you can access any property name (even ones that don't exist on the class). So you can do event.currentTarget.completelyFakeProperty
with flash.events.Event
and there won't be any compile-time errors. In Starling, though, you need to cast currentTarget
to the correct type if you want to access a property that is not defined on EventDispatcher
.
var myObject:SomeType = SomeType(event.currentTarget);
or
var myObject:SomeType = event.currentTarget as SomeType;