[haXe] extending movieclip

Jonathan Gee mandella at gmail.com
Sun Apr 9 20:48:20 CEST 2006


hello,
i'm trying to extend movieclip but its not working, first of all let me
paste the code that i am using:

//Test.hxml
-cp src
-swf Test.swf
-main Test

//Test.hx
import flash.MovieClip;
import TestMC;

class Test{
    static function main()
    {
        var mc:MovieClip = flash.Lib.current;
        mc.attachMovie("TestMC","tmc",10);
    }
}

//TestMC.hx
import flash.MovieClip;

class TestMC extends MovieClip
{
    public var holder:MovieClip;

    public function new(){}

    public function onLoad()
    {
        trace("onLoad");
        trace(holder);
        createEmptyMovieClip("holder",10);
        trace(holder);
        var mc:MovieClip = this;
        mc.beginFill(0xFF0000);
        mc.moveTo(50,50);
        mc.lineTo(100,50);
        mc.lineTo(100,100);
        mc.lineTo(50,100);
        mc.endFill();
    }
}
//
ok, for those that stuck around to read this, thanks.  the trace reports:

TestMC.hx:11 onLoad
TestMC.hx:12 null
TestMC.hx:14 null

and i'm not showing a red square when i view the swf, just those trace
reports.  so, i'm a little stumped as to why its not working.
i r using beta 4.

so, whats going on?

-j
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20060409/c71c422c/attachment.htm


More information about the Haxe mailing list