I’m currently working on reviving an old AS2 project.
It’s important that it targets Flash Player, but I’ve noticed when trying OpenFL that even the simplest project comes with a hefty overhead.
Exporting a blank project with just trace("Hello World") creates an SWF of 239kb and it takes several seconds for it to run the first frame, even longer if I try debugging with FDB.
When I first tried OpenFL years ago, I don’t remember this being a problem.
Do I need to use an older version of OpenFL if I want to target Flash efficiently?
.
Firstly, I don’t understand what you mean by “locating flash”?
.
Actually, it’s the “HTML5 gaming era” now, why do you still want to create “flash”?
.
I never said “locating flash”.
I’m aware it’s the quote - HTML5 gaming era - unquote and support for Flash on browsers ended several years ago. It’s still a build target so I figured it’s still supported.
I am not using the SWF library yet and the swf is still quite large and very slow to load in the debugger.
I realised if I build with -release it’s relatively quick to start in Flash Player.
I’m concerned though once I’ve ported much of the old project over to openfl, it will become much too slow on start up for debugging or otherwise.
Some of that is Haxe’s standard library. Some of that is classes and inline functions required to make things work across multiple targets in OpenFL. I suspect that we can tweak our conditional compilation a bit more to remove some of those classes that aren’t strictly needed, but I also suspect that using OpenFL will always add a bit more to the file size than using Haxe directly to target Flash without OpenFL. We have an assets system, tilemaps, and some other features that don’t exist in vanilla Flash.
Flash is indeed still a supported build target. We will support Flash as long as Haxe still supports Flash. Even if Haxe drops Flash support, we will likely support the final Haxe version that still supports Flash for as long as feasible. Flash is a very important target for us because we often want to test the same code running in both Flash and OpenFL to be sure that our behavior matches.
Release builds are definitely faster, even in AS3.
I suspect that any additional overhead that you are seeing is not compounding. It’s probably just a one-time cost.
For reference, Moonshine IDE was originally built in Flex with AS3, and it is being incrementally ported over to Haxe and OpenFL with Feathers UI. We have not seen significant decreases in performance, and it is a HUGE and complex codebase.
Yeah, debug builds for Flash are VERY slow compared to release builds. When they start up, they try to connect to a debugger. I always had this problem even when coding directly in AS3 instead of Haxe, so it’s not an OpenFL issue.