[haXe] Access to Stage in AS3 from haxe

Nicolas Cannasse ncannasse at motion-twin.com
Tue Sep 19 09:36:18 CEST 2006


> Hi list i try to modify the stage alignement properties and scaling from
> HAXE code and the player return this error.
> 
> /*code*/
>         var stage = new flash.display.Stage();
>         stage.align = flash.display.StageAlign.TOP_LEFT;
>         stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
> /**/
> 
> ArgumentError: Error #2012: Stage class cannot be instantiated.
>     at Demo$/main()
>     at MethodInfo-62()
>     at flash::Boot$iinit()
> 
> How can achieve this with HAXE?

Try using the following :

var stage = flash.Lib.current.stage;

Nicolas



More information about the Haxe mailing list