i will be working for a quite big flex-air project where I am supposed to write some kind of plugins.
These are relatively independent from the main-app and just need to listen to Events and dispatch Events themselves which the main-app will listen to.
Since I just recently started the move over to Haxe / openFl I would really like to develop these plugins with this system.
Since I can target air and flash, I guess that should be possible, right?
Thanks for insight.
Haxe Flash applications can be used from ordinary ActionScript SWFs but just know that the main timeline is placed in a generated “boot” class which is randomly named in order to prevent collisions. If you need to access the main timeline then you may want to use
-D haxe_boot which forces this class to be called “haxe” in order to be easier to reference. You may want to load the SWF in its own ApplicationDomain though if you load more than one so they do not collide with each other.
We embed our assets by default and push them into a first frame then advance to the second frame of the SWF automatically after preloading is complete. This may cause some trouble but there are technical solutions to this if it presents trouble
but what about the other way around: Can I implement as3 classes inside an haxe / openfl project?
It should be possible to include pre-compiled SWF content in a Flash application:
You can reference the types at runtime or with externs should be able to instantiate or extend them. Just be aware if you are extending an ActionScript type that overriding getters and setters or fields that use
:Object might take extra work to override with Haxe