Change window title in runtime?

I notice that in application config
there’s a variable called "titles"
http://docs.openfl.org/lime/app/Config.html
so I want to try whether I can change the window title in runtime or not

but it met an exception when I just added “import lime.app.Application” and “lime.app.Config”

Could not find primitive lime_system_gettimer__0.
Could not find primitive lime_system_gettimer__0.
Could not find primitive lime_system_gettimer__0.
Bad ByteArray
Called from extern.cffi (C:/HaxeToolkit/haxe/lib/hxcpp/3,1,68/src/hx/Lib.cpp line 140)
Called from openfl._v2.text.Font.loadBytes (openfl/_v2/text/Font.hx line 106)
Called from openfl._v2.text.Font.__fromBytes (openfl/_v2/text/Font.hx line 140)
Called from openfl._v2.text.Font.new (openfl/_v2/text/Font.hx line 32)
Called from __ASSET__fixed_ttf.new (DefaultAssetLibrary.hx line 4696)
Called from Type.createInstance (C:\HaxeToolkit\haxe\std/cpp/_std/Type.hx line 82)
Called from openfl._v2.text.Font.registerFont (openfl/_v2/text/Font.hx line 114)
Called from DefaultAssetLibrary.new (DefaultAssetLibrary.hx line 2116)
Called from openfl._v2.Assets.initialize (openfl/_v2/Assets.hx line 580)
Called from *._Function_1_1 (ApplicationMain.hx line 84)

if I remove “import” section from code, everything normal again

did I messed up something?

By default for native apps OpenFL uses Lime legacy and lime.app.Application doesn’t exist in Lime Legacy. It’s trying to call the new class but this fails when it tries to find a c++ function that it needs. You could try compiling your app with OpenFL Next by adding a -Dnext in the compile command but as far as I know Next is still not feature complete and things may be broken/missing for native platforms.

Do you want to change it once at runtime (right when it’s starting) or do you want to change it on-the-fly? The latter scenario is not supported, but use of a custom template could handle the first.

Long-term, I’d love to see Lime supporting proper at runtime title changes, it would not be hard to add at all, but like @bubba_169 pointed out, this is when using -Dnext for OpenFL, which is still developing