Lime 8.0.0 and OpenFL 9.2.0 Release

Hello everyone!

Lime 8.0.0 and OpenFL 9.2.0 have now officially released on Github and will be submitted to Haxelib shortly!

Quite a lot has happened in the time since OpenFL 9.1.0 including a few shakeups such as leadership changes and a Lime domain move from lime.software to lime.openfl.org. More importantly, we have some impressive stuff by the core team (like the new filesystem package by yours truly :wink:). Also noteworthy is that both Josh Tynjala and I have now been added to the Haxelib contributors list which should allow us to improve the timeliness and execution of future releases.

I’m extremely excited about the new Lime and OpenFL and I want to share so much thanks to everyone who contributed during this release cycle. - plus a special thanks to @joshtynjala and @player_03 for putting in so much effort to get this one out.

This update contains a lot of fixes, improvements and other goodies, but I feel like we are just getting started - so look forward toward more exciting things to follow!

Changelog

OpenFL

  • Added openfl.text.StyleSheet implementation for TextField
  • Added scaleMode implementation to Stage
  • Added automatic scaling on HiDPI screens when window.allow-high-dpi enabled in project (use -Dopenfl-disable-hdpi to restore old behavior)
  • Added File, FileStream, and FileMode in the openfl.filesystem package to read and write files on native platforms
  • Added openfl.desktop.NativeProcess to run executables on native platforms
  • Added openfl.display.ChildAccess abstract to simplify access to nested display objects
  • Added openfl.net.IDynamicPropertyOutput and openfl.net.IDynamicPropertyWriter interfaces
  • Added openfl.net.Responder, openfl.utils.Namespace, and openfl.utils.QName classes
  • Added isXMLName, registerClassAlias, and getClassByAlias static methods to openfl.Lib
  • Added condenseWhite property to TextField for htmlText whitespace removal
  • Added openfl.globalization.DateTimeFormatter implementation for HTML5 and Flash (defaults to en_US on native platforms)
  • Added some and every methods to Vector
  • Added session cookie management for URLLoader on native platforms
  • Added Stage 3D to the DOM renderer on HTML5
  • Added optional text measurement with DIV on HTML5 (use -Dopenfl-measuretext-div)
  • Added fromBundle static method to openfl.utils.AssetLibrary
  • Improved TextField DOM rendering and measurement on HTML5
  • Improved Font.enumerateFonts to return device fonts, if specified
  • Improved visibility of focused TextField on mobile by specifying its global rectangle
  • Improved restrict parsing in TextField when it contains multiple ^ characters
  • Improved <li> element rendering in TextField by adding line breaks and displaying bullets
  • Improved htmlText parsing in TextField for HTML entity character codes like &#38; and &#x20AC;
  • Improved positioning of underline in TextField
  • Improved URLVariables syntax compatibility with Flash by adding @:arrayAccess
  • Improved implementation of openfl.utils.Object
  • Improved output file size when Lime sets disable_preloader_assets
  • Improved getMusic method on Assets to allow streaming Vorbis files on native platforms
  • Improved FLA library support by allowing Sprite to be used as linkage base class
  • Fixed rendering of UTF-8 characters on macOS
  • Fixed the last line in a TextField getting cut off sometimes when auto-sized
  • Fixed inconsistent letter spacing in TextField
  • Fixed missing bold and italic variants in TextField on native platforms
  • Fixed missing Event.OPEN dispatch in Loader and URLLoader
  • Fixed missing bubbling of TextEvent.LINK
  • Fixed signature of splice method on Vector
  • Fixed missing dispatch of FocusEvent.MOUSE_FOCUS_CHANGE in some situations
  • Fixed rendering of openfl.text.StaticText

Lime

  • Updated HashLink to version 1.12
  • Updated Android minimum SDK version to 21
  • Updated Electron template to version 18
  • Updated HTML5 to high DPI by default
  • Added --template command line option to Lime tools
  • Added --appstore and --adhoc command line options for AIR on iOS to Lime tools (to match iOS native)
  • Added -air-simulator command line option for AIR to Lime tools (avoids packaging full AIR app)
  • Added <config:air profile="value"/> to optionally support custom AIR profiles in simulator
  • Added setTextInputRect to Window to specify a rectangle that has focus for text input
  • Added JNISafety to improve JNI communication on Android
  • Added manageCookies to HTTPRequest to support cookies on native platforms (only session for now)
  • Added pitch property to AudioSource
  • Added -Delectron flag to Electron builds so that it’s possible to use #if electron
  • Added icon priorities to allow a library to provide a default icon that the user can override
  • Improved HashLink .app file generation on macOS
  • Improved performance of HTTPRequest on native platforms with better buffer management
  • Improved support for Android 12 (SDK 31) and newer
  • Improved output file size if no assets are defined (sets disable_preloader_assets define)
  • Improved stage sizing on Electron (defaults to 0 for fluid width/height, same as regular browsers)
  • Fixed garbage collector crash issue on iOS 12
  • Fixed iOS build that failed because of missing Metal.framework dependency
  • Fixed switching between light and dark modes on Android destroying the Lime activity
  • Fixed getCurrentTime on AudioSource for streaming sounds on native platforms
  • Fixed wrong types on NativeMenuItem Flash externs
  • Fixed set clipboard when null is passed (now changes to an empty string automatically)
  • Fixed warnings for deprecated “devicemotion” events on Firefox
  • Fixed incompatibility with “genes” Haxelib to allow generating JS Modules
18 Likes

OpenFL 9.2.0 also adds a new @:bind syntax that enables you to define your own custom base classes in Haxe that bind with symbols you have defined in a SWF or Adobe Animate project. This has been a long requested feature and a super-awesome, super-important improvement for you SWF lovers out there!

Step 1 – Export for ActionScript

In Adobe Animate, choose a class name and leave the base class alone as flash.display.MovieClip (this is required for Animate to properly compile your SWF).

Step 2 – Create a Haxe base class

You can simply use @:bind if your Haxe base class has the same name as what you used in Animate.

package com.my;

import openfl.display.MovieClip;

@:bind class BindClass extends MovieClip
{
    public function new()
    {
        super();
        trace("Hello from my base class!");
    }
}

You can also use the @:native meta-data tag if your Haxe class name does not match up with the one specified within Adobe Animate or your published SWF.

import openfl.display.MovieClip;

@:bind @:native("com.my.BindClass") class MyCustomBaseClass extends MovieClip
{
    public function new()
    {
        super();
        trace("Hello from my base class!");
    }
}

Step 3 – Create a new instance of your SWF symbol

If you have auto-class generation enabled for your SWF library (the default), you should be able to create a new instance of your symbol directly:

var symbol = new BindSymbol();

Otherwise you can also create an instance using openfl.utils.Assets

var symbol = Assets.getMovieClip("mylibrary:BindSymbol");

The @:bind syntax is especially useful because it works for symbols that are instantiated automatically as part of a timeline. Previously it was a giant headache to try and track-down every time one of these symbols were instantiated to try and attach the desired functionality to each copy. Now as they are instantiated, they will automatically link up to your bound base class, similar to how @:bind works with the built-in Haxe Flash target.

Remember, you need both the new version of the SWF library and OpenFL to work together for this feature. And if you decide to create your own asset libraries, OpenFL now includes the internal wiring to add @:bind syntax of your own. Asset libraries are a little-used (and super-powerful) feature that can create native MovieClips out of any resource type you can think of – spritesheets, tiles, flump, texturepacker, you name it – with a little elbow grease. I’d love to see more use of this feature

SWF 3.1.0 (08/31/2022)

  • Added support for OpenFL 9.2 @:bind to extend SWF symbol classes
  • Added support to extend Sprite classes (in addition to MovieClip)
  • Added initial support for SWC files
  • Added support for multiple labels per frame in Animate libraries
  • Improved MovieClip animation performance in Animate libraries
  • Improved class generation to allow generate="false" to disable
  • Fixed initialization order to allow extending generating classes
  • Fixed support for Assets.exists without specifying asset type
  • Fixed Std.is deprecation warnings
11 Likes

WOW! These are fantastic news. The new features are stunning and VERY useful! Thank you for bringing this to life!

1 Like

I am grateful for all the work you guys have put in, thanks so much!

1 Like

This is huge! My thanks to everyone who’s contributed to this! :star_struck:

1 Like

Wow, this is great news! Thank for keeping it up!
time to update everything has finally come :slight_smile:

1 Like

OH! MY! GOD!
These three just made my day!!!

  • Updated Android minimum SDK version to 21
  • Improved support for Android 12 (SDK 31) and newer
  • Fixed garbage collector crash issue on iOS 12

Thank you!

2 Likes

Still need to use it?
<application android:allowNativeHeapPointerTagging="false">

That change is coming soon. Not sure if it’ll make the next patch, but if not, it’ll be in the one after.

By the way, which NDK version is supposed to be used for the Android build now?

I want test new version lime 8.0.0 and openfl 9.2.0 but got
Error: Invalid field access : length
Build halted with errors.
image
image

Anyone know what is wrong?

I found what cause the error : invalid field access : length, Its working when I remove this library path.

library path=“assets/swf/animation.swf” id=“swf-anim” preload=“true”

what wrong with the library path?

I tried example Nyancat 8.7.0 also got same error.

1 Like

r21e should be the newest NDK version that works.

2 Likes

As I’ve said, that’s only if you never run lime rebuild android. If you need to rebuild, you’ll either have to go back to r15c or wait for the submodule update.

Speaking of which, I know I said the tagged pointer fix would come in 1-2 patches, but I actually think we should save it for the submodule update (2-3 patches). If we’re going to make big changes to the Android build process, might as well do it all at once.

1 Like

This one, right?
ndk;21.4.7075529
Just have realized that .4 stands for version #5 (starting from 0) and ‘e’ if the 5th letter in the alphabet. :exploding_head:

Yes, that seems like the correct version number.

Anyone can run openfl-samples nyancat with openfl 9.2.0 and lime 8.0.0 for html build?

I’m using flashdevelop-development version.

Do you get this error?

Error: Invalid field access : length

We’ve found that there’s a bug in the new swf 3.1.0. We plan to release an update to fix it soon. However, until then, there is a workaround that you can try.

First, run this command to figure out where swf is installed.

haxelib libpath swf

Then, go to that path (on my Mac, it’s /usr/local/lib/haxe/lib/swf/3,1,0/, but it’ll be different on Windows):

cd /usr/local/lib/haxe/lib/swf/3,1,0/

Then, run this command:

haxe rebuild.hxml
1 Like

Thank you so much! It’s work :wink:

1 Like

FYI — I just released swf 3.1.1, which includes the fix for this error.

1 Like