JSON file with Hex values....wont load.
-
So I'm trying to implement a skin file approach for a product. I have a json array that I can use, and now I'd like it to sit on disk so end users can alter it.
here's my JSON:
{ "highlight": 0xFF33BCE0, "panelLight":0xFF5C5C5C, "panelDark":0xFF484747, "panelHeader": 0xFF3B3B3B, "darkHighlight":0xFF3B3B3B, "knobColour": 0x55FFFFFF, "dropShadow": 0x3D333333, "OnOffOuter": 0xFF1F1F1F, "OnOffDotOn": 0xFF1F1F1F, "OnOffDotOff": 0xFF1F1F1F, "comboBack": 0xFF3B3B3B, "comboDropText": 0xFFA3A3A3, "comboDropHighlightText": 0xFF333333, "textEdge" : 0x55FFFFFF, "textColour": 0xFF333333, "textAltColour": 0xFFA3A3A3, "buttonStdColour": 0xFFA3A3A3 }
but when I try and load this with :
var thisAppData = FileSystem.getFolder(FileSystem.AppData); var sfile = thisAppData.getChildFile("Player.skin"); reg skin = sfile.loadAsObject();
I get an error in my JSON file:
LAF.js (56): 2:17: error: Syntax error in number
so it seems the load doesn't like the use of Hex values, any clue how to implement this?
-
What about putting the hex value within quotes?
Another option is to use the integer representation.
-
@d-healey Yeah putting the h3x values in quotes seems to have worked...I should have tried that earlier - t-shirt time...