[haXe] HAXE Casting MovieClip as Haxe Class

Nicolas Cannasse ncannasse at motion-twin.com
Mon Sep 11 09:37:32 CEST 2006


> Does HAXE apply a recursive casting in child movieClips if you cast the
> parent of them.??

You don't need to cast to get the correct type actually.
Casting just transform the type "MovieClip" returned by attachMovie into
"MyClass" which extends MovieClip. It checks of course at runtime if
this MovieClip is actually an instance of MyClass but does not do any
conversion.

BTW, you don't need the following lines :

import TabBarMenu;
import TabButton;

Since imports are automatic in haXe (like Java/AS2).

Nicolas




More information about the Haxe mailing list