Where to download Flash CC extension for OpenFL?

As I have read about the new custom development platform feature for Adobe Flash, I am wondering if I can start experimenting with OpenFL and Flash IDE?

What I hope is to be able to use haxe instead of javascript or as3 in flash projects, is this possible?
Where to download the extension of OpenFL?

Is it a dream to write haxe code in the timeline of flash? or linking to external haxe based class?


Any one? any link is appreciated …

I don’t think it is out yet. But from what I’ve heard it should be soon…

I am following openFL at twitter, such news will be really significant!

The extension has not been released, though you can begin working with the SWF library and the (beta) new features immediately.

1.) Add <haxelib name="swf" /> to your project
2.) Add <library path="to/your.swf" /> to your project as needed

Optionally, add the following attributes to the <library /> tag:

  • type="swflite" forces SWFLite output instead of SWF
  • preload="true" should preload so Assets.loadLibrary is unnecessary
  • generate="true" should generate Haxe classes, matching the AS3 export classes

When I try to add this line in my project:

<library path="assets/my-movie.swf" generate="true" preload="true"/>

the project will not start, and I got error in javascript:

Uncaught Invalid char { at position 0
test2.js:3153 haxe_Unserializer.unserialize
test2.js:2307 format_swf_lite_SWFLite.unserialize
test2.js:1519 MyMovie
test2.js:910 $extend.initHaxe
test2.js:920 $extend.added
test2.js:18654 ftest2.js:110 openfl_events_EventDispatcher.dispatchEvent
test2.js:176 $extend.dispatchEvent
test2.js:790 $extend.__setStageReference
test2.js:557 $extend.addChild
test2.js:893 Main.main
test2.js:1622 Reflect.callMethod
test2.js:59 ApplicationMain.start
test2.js:40 ApplicationMain.init
test2.js:4362 lime_app_Preloader.start
test2.js:16770 $extend.display_onCompletetest2.js:18654 f
test2.js:110 openfl_events_EventDispatcher.dispatchEvent
test2.js:176 $extend.dispatchEvent
test2.js:1588 $extend.onLoaded
test2.js:16759 $extend.start
test2.js:4374 lime_app_Preloader.loader_onComplete
test2.js:18654 f
test2.js:8686 lime_net_URLLoader.__onData
test2.js:8523 subject.onreadystatechange

At line:

throw "Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos;

As below:

case 67:
			var name3 = this.unserialize();
			var cl1 = this.resolver.resolveClass(name3);
			if(cl1 == null) throw "Class not found " + name3;
			var o2 = Type.createEmptyInstance(cl1);
			if(this.get(this.pos++) != 103) throw "Invalid custom data";
			return o2;
		throw "Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos;

If I remove preload=“true”, the project will work normally, but I still have the error above when try to instances instances from SWF file

My haxelib are:

actuate: [1.7.5]
createjs: [1.5.7]
lime: [2.0.0-beta]
openfl: [2.1.5]
swf: [1.7.0]

Is there a working HTML5 example I can see?

p.s: when targeting flash, every thing works fine, the swf library is loaded and I can instantiate from its AS3 classes

Strange, are all your libraries up-to-date?

Here are my libraries installed:

actuate: [1.7.5]
lime: [2.0.0]
openfl: [2.1.6]
swf: [1.7.0]

Aren’t they up-to-date?

Does this occur using the “SimpleSWFLayout” sample, and if so, which targets?

It does occur using the “SimpleSWFLayout” sample, at HTML5 target, I’ve got the same error.

Would you mind testing other targets (like Flash, Neko or C++) to see if it occurs as well?

Works fine on Neko& Flash, but at Windows I get this error:

Building SimpleSWFLayout
haxelib run openfl build C:\openfl\openfl-samples\SimpleSWFLayout\project.xml windows
C:\openfl\openfl-samples\SimpleSWFLayout\Export\windows\cpp\obj>setlocal enabledelayedexpansion 
Warning: Could not find environment variables for Visual Studio
Error: Could not automatically setup MSVC
Build halted with errors (haxelib.exe).

But, in my project, I just need html5

I’m trying to port a small project to html5 and I have the same error (using all latest libs).

I put a trace in the SWFLite class and the data is trying to unserialize starts like this:

{"root":{"type":"sprite","className":null,"id":null,"frames":[{"label":null,"objects":[]}]},"symbols":[{"symbol":{"type":"shape","className":"DefineShape3","id":111,"commands":[{"type":4,"params":[null,null,null,null,null,null,null,null]}, ...

Mine looks like this:


Perhaps there is something wrong with the build.

Would you mind going to “tools” in the SWF library, and running haxe build.hxml (to recompile the SWF tools) and seeing if that makes a difference?

Hey guys,

I just found that the build was breaking on the server, but that the server was not reporting an error. I just re-released SWF 1.7.0 on haxelib, so please haxelib remove swf and haxelib install swf and try again

It seems to be working now, thanks Joshua!

Thanks guys, I’m sorry for the trouble. Glad we’re all seeing the same thing now! :slight_smile: :success:

Thanks Joshua, but now I have a different error:

XMLHttpRequest cannot load file:///D:/c/documents/openFL%20projects/test2/bin/html5/bin/libraries/my-movie.dat. Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https, chrome-extension-resource.test2.js:8616 lime_net_URLLoader.requestUrl
test2.js:8616 Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///D:/c/documents/openFL%20projects/test2/bin/html5/bin/libraries/my-movie.dat'.

Does that mean that I can’t use it offline? ex: opening the index.html file directly?

Did you use “openfl test”? It should boot a local web server, to get around cross-origin errors, which would occur locally unless you disable security in your browser

I tried IE to open index.html locally, the progress bar will show, but, then, nothing happens, and no errors too…

Any way, can I use HTML5 target without webGL ? As we need to build widgets for iBooks, iBook does support HTML5 canvas, but does not support webGL