JStack icon indicating copy to clipboard operation
JStack copied to clipboard

OpenFL compatibility

Open Gama11 opened this issue 7 years ago • 2 comments

JStack doesn't seem usable with OpenFL projects atm, because it doesn't support constructors / new() as entry points.

> openfl create project JStackTest
> cd JstackTest

Add this to project.xml:

<haxelib name="jstack" />
<haxedef name="JSTACK_MAIN=Main.new" />

Running openfl test html5 results in this error:

Source/Main.hx:12: characters 2-10 : Cannot call super constructor outside class constructor
Source/Main.hx:10: lines 10-16 : Missing super constructor call

Versions used:

  • JStack 2.3.9
  • OpenFL 8.0.1
  • Lime 6.3.0
  • Haxe 3.4.7

Gama11 avatar May 09 '18 15:05 Gama11

Till this is fixed you can use ordinary entry point as a workaround. AFAIR OpenFL supports it.

class MyClass extends Sprite {
  static public function main() Lib.addChild(new MyClass());
}

RealyUniqueName avatar May 10 '18 10:05 RealyUniqueName

Yep, it does, probably should have mentioned that. 👍

Gama11 avatar May 10 '18 10:05 Gama11