error related with PNG recompression option

Get help using Construct 2

Post » Wed Aug 21, 2013 8:23 pm


i'm writing plugin to find out browser's language setting regardless of platforms.

http://www.scirra.com/forum/plugin-browser-language_topic74599.html

to support windows8, this plugin (runtime.js) need to call WinJS libray (Windows.System.UserProfile.GlobalizationPreferences.languages) like following.

          if (typeof WinJS!="undefined") {//windows8
      var codes = Windows.System.UserProfile.GlobalizationPreferences.languages;
      code=codes[0].substr(0,2);
    }
    
if set PNG recompression: None and uncheck Minify script in Windows8-Export Options , exported html works well in windows8 simulator.

but if set PNG recompression: Standard and check Minify script in Windows8-Export Options, exported html complains error with following message in windows8 simulator.

Unhandled exception at line 205, column 218 in ms-appx://89bc4ec2-6e35-4d51-aa67-a9c1041f101b/www/c2runtime.js

0x800a138f - JavaScript runtime error: Unable to get property 'on' of undefined or null reference

..."undefined"!=typeof WinJS&&(c=Windows.ln.on.um.Hn[0].substr(0,2)...

how can i remove this error.

thanks in advance
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Wed Aug 21, 2013 9:53 pm

You might need something like
Windows["System"]["UserProfile"][GlobalizationPreferences"]["languages"]

See this thread:
http://www.scirra.com/forum/plugin-developers-please-test-with-the-minifier_topic45502_page1.html
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Thu Aug 22, 2013 2:56 am

ramones,

thanks a lot,the error was removed with your help.
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest