haXe Forum > haxe bug with Flas CS3?
-
Roberto Ferrer Mar 16 at 15:35
Hi everybody, I have used some time ago haxe with Flash 8 and everything goes well !!! Now I am trying to use Flash CS3 and haxe/AS3 with FlashDevelop but I am having some problems.
I create in Flash CS3 a file called :library.swf which contains the assets, in this case: Ball and Box (two movieclips), I put them in the flash lib and Right Click --> Linkage --> Export for ActionScript
In Flash Develop I create 2 class to inherit from Ball and Box (the same way I did in flash 8 and FD):
Ball.hx and Box.hx, the both inherits from MovieClip.
//file Ball.hx import flash.display.MovieClip class Ball extends MovieClip { public function new() { super() } } //file Box.hx import flash.display.MovieClip class Box extends MovieClip { public function new() { super() } }
After in the main class://MainInterface.hx import Ball; import Box; class MainInterface extends MovieClip { var ball1:Ball; var box1:Box; public function new() { super(); ball1 = new Ball(); box1= new Box(); // this.addChild(box1); this.addChild(ball1); } }
Anyway the compile SWF with haxe only show the Box, it doenst matter if I comment this.addChild(box1), the Ball doesnt show. It´s like is linking all the classes that inherits from MovieClip to the Box movieclip defined in the library.
It was the same way using Flash8 and AS3 in hace and works fine, I cant figure what is wrong with CS3 and haxe now. -
Roberto Ferrer Mar 17 at 13:25
Sorry for the message, its not a bug of haxe with Flash CS3. The problem was that even I am using Flash CS3 to build de library with the assets, FlashDevelop adds the library.swf to the Library and uses SWFMILL to build his own library assets (including inside the generated file with Flash CS3).
Solution: Dont add to the FlashDevelop library the generated swf file, go to Project Options, Compiles Options and add -swf-lib path_to_lib_file.swf .Now, everything goes well.
Regards!!!