Lime.embed parameters


#1

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?


#2

Using loaderInfo.parameters, of course!

Let me know if you have any issues :slight_smile:


#3

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


#4

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


#5

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.


#6

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


#7

Thanks a lot! :slight_smile: