Lime.embed parameters

Hi,

I’m currently porting a bigger flash game to html using lime, which works fine!

The game is embedded in in a server generated html page an here i need to pass some parameters to the haxe app. I tried to add data to the parameters field in the window config, which seems to work:

lime.embed ("mars", "content", 0, 0, { "rootPath":"@assetsUrl", "parameters": { "accountUrl":"@accountUrl", "masterUrl":"@masterUrl" } } );

But how can i access this data in the haxe project?

Using loaderInfo.parameters, of course!

Let me know if you have any issues :slight_smile:

But this is openFL? Currently i’m only using lime, the last time I tried to include openFL IT broke my stuff :confused: And i’m almost done

Oh, haha, okay, sorry, I thought you were using OpenFL.

Try window.attributes.parameters for Lime 7, it might have been window.config.parameters in previous versions

I only see a private __attributes, what is the best way to access it? My quickfix was

parameters = __attributes.parameters;

in the window constructor, because parameters was not used and i first thought that i could find the data here.

It looks like window.parameters is what it should be, but that we weren’t setting this based on the attributes :blush:

1 Like

Thanks a lot! :slight_smile: