Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshtynjala/openfl-swc-sample
A sample OpenFL and Haxe project that compiles a .swc library for ActionScript 3.0 developers
https://github.com/joshtynjala/openfl-swc-sample
actionscript adobe-air adobe-flash as3 haxe openfl openfl-samples
Last synced: 19 days ago
JSON representation
A sample OpenFL and Haxe project that compiles a .swc library for ActionScript 3.0 developers
- Host: GitHub
- URL: https://github.com/joshtynjala/openfl-swc-sample
- Owner: joshtynjala
- License: mit
- Created: 2022-01-23T22:50:53.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-11-16T22:19:54.000Z (about 1 year ago)
- Last Synced: 2024-10-30T08:26:04.115Z (2 months ago)
- Topics: actionscript, adobe-air, adobe-flash, as3, haxe, openfl, openfl-samples
- Language: Haxe
- Homepage:
- Size: 10.7 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Create SWC Library with OpenFL Sample
Demonstrates how to create a _.swc_ library for ActionScript 3.0 using [OpenFL](https://openfl.org/) and [Haxe](https://haxe.org/). This allows AS3 developers using Adobe AIR to access Haxe libraries too.
To build the _.swc_ library, use the following command:
```sh
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.
```sh
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:
```as3
haxe.initSwc(null);
```Sample created by [Josh Tynjala](https://github.com/sponsors/joshtynjala), the author of [Feathers UI](https://feathersui.com/) and core contributor to [OpenFL](https://openfl.org/).