Assetsprefix HTML5 target

Just a few weeks ago I found out that there is an additional parameter to the openfl.embed function which let’s me specify a different folder for my assets.
E.g. app.embed (“openfl-content”, 800, 600, “63A1FF”,"/sharedAssets/applicationA/");
With the latest versions of OpenFL & Lime this doesn’t seem to work anymore.
As @matteusMuis pointed out in this thread: Black screen without errors HTML5
the embed function seems to have changed and looks like this now:
lime.embed ("::APP_FILE::", “canvas-wrapper”, ::WIN_WIDTH::, ::WIN_HEIGHT::, { parameters: {} });

Well well - where do I specify my path now and what are those parameters?

The new lime.embed accepts an object similar to the lime.app.Config object:

Some of the properties don’t apply at runtime, but others that make sense such as fps or rootPath should be available.

Instead of using a windows array for window properties (such as background, parameters, etc) currently the lime.embed method allows these to also be set on the same object.

parameters maps to the loaderInfo.parameters value found in OpenFL :slight_smile:

Thanks for the information singmajesty! As usual your help is invaluable.
Unfortunately I’m still a little lost though because I simply don’t know where
to define that config object. :wink:
In previous projects I simply changed the line actually embedding the game
inside index.html after compilation. Like:
worldsbestapplication.embed (“openfl-content”, 800, 600, “63A1FF”);
to
worldsbestapplication.embed (“openfl-content”, 800, 600, “63A1FF”,"/sharedAssets/worldsBestApplication/");

What do I have to do now?

Try:

lime.embed ("::APP_FILE::", "openfl-content", ::WIN_WIDTH::, ::WIN_HEIGHT::, { rootPath: "/sharedAssets/worldsBestApplication/", parameters: {} });
1 Like

Thanks singmajesty! That did the trick. :slight_smile:
By the way, the parameter is called rootPath - what’s assetsPrefix good for then?
Did I confound things?

It was renamed :slight_smile: