[haXe] Method checking
Nicolas Cannasse
ncannasse at motion-twin.com
Thu Apr 6 14:23:09 CEST 2006
>> It's a feature. MovieClip implements Dynamic, so you can call methods
>> even if they
>> are not declared.
>
>
> I see. I guess there are good reasons for this design choice... For
> me, I would love to have the choice of a stricter version of MovieClip
> that didn't implement Dynamic.
Yes I understand what you mean there :)
The reason why MovieClip is Dynamic is to mimic the AS2 behavior and
enable Flash users to "feel at home" when using haXe Flash APIs. There
is a lot of quirks in the Flash APIs design, such as polymorphic
arguments types, optional arguments and even strange things such as
optional arguments inserted at the *beginning* of a function call
(namely TextField.setTextFormat).
Working with a more strict API would be a nice thing (we're doing that
for Motion-Types) but will break some compatibility. The best then is to
design some wrappers that would provide a slightly modified but strictly
typed API.
Nicolas
More information about the Haxe
mailing list