Skip to content

joshtynjala/openfl-swc-sample

Repository files navigation

Create SWC Library with OpenFL Sample

Demonstrates how to create a .swc library for ActionScript 3.0 using OpenFL and Haxe. This allows AS3 developers using Adobe AIR to access Haxe libraries too.

To build the .swc library, use the following command:

openfl build flash -debug

The file will be created at bin/flash/bin/mylibrary.swc.

To use the .swc library in an ActionScript project, add it with the --library-path compiler option.

mxmlc --library-path+=mylibrary.swc

During startup, such as in the constructor of the main AS3 class, you should add the following AS3 code because it initializes a few things that are expected by Haxe-compiled .swc libraries:

haxe.initSwc(null);

Sample created by Josh Tynjala, the author of Feathers UI and core contributor to OpenFL.

About

A sample OpenFL and Haxe project that compiles a .swc library for ActionScript 3.0 developers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages