[haXe] Changing "Using HAXE from AS2" into "Using HAXE from HAXE"

E.P. de Boer eddydeboer1 at home.nl
Sat Apr 22 12:04:11 CEST 2006


Thanks for your comments on the code Nicolas it made a lot of things clear,

Sorry for bothering you again so soon, but I'm stuck at the following issue:

The dynamic creation of properties for the MovieClipLoader doesn't seem to
work in the code.
When trying to create the onLoadInit function by assigning onInit, the
compiler comes with the following message:

C:\Haxe\Projects\Haxe2Haxe>as2test.hxml
AS2Test.hx:10: characters 3-17 : flash.MovieClipLoader have no field
onLoadInit

I think the question is : what mechanism does HAXE support to make this part
work?

Down here is the latest source:

		import flash.MovieClipLoader;
		import flash.MovieClip;

		class AS2Test {
			var mcl : MovieClipLoader;
			function new() {

				 flash.Lib._root.createEmptyMovieClip("haxe_mc",0);
				 mcl = new flash.MovieClipLoader();
				 mcl.onLoadInit = onInit;
				 mcl.loadClip("haxe.swf", flash.Lib._root.haxe_mc);
			}

			function onInit() {
				var test = Reflect.createInstance(flash.Lib._root.haxe_mc.Test,[55]);
				flash.Lib._root.createTextField("tf",1,0,0,100,100);
				flash.Lib._root.tf.text = test.foo();
			}
		}


Kind regards,

Eddy de Boer









More information about the Haxe mailing list