clark Posted March 31, 2014 Share Posted March 31, 2014 Hey! I know this is not directly related to Phaser. However, here is the situation! We have a CDN and locally, we want to load from the CDN when doing Dev. When we do this we get this: Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at blah.com/blah/blah/atlaspreloader.png may not be loaded. I have seen in the past that on phaser and pixi's API is a crossOrigin property which is boolean. Can anyone explain what is happening here? We are unsure how to proceed. Should this be a local thing, where, we need to disable some kind of browser (chrome) options for development. Or is there something on the server side that must be done too?Basically how do we work around this issue?Thanks! Clark. Link to comment Share on other sites More sharing options...
rich Posted April 1, 2014 Share Posted April 1, 2014 crossOrigin is a boolean OR a string, and in some cases it needs setting (often to "Anonymous"). More details here: https://developer.mozilla.org/en-US/docs/HTML/CORS_Enabled_Image clark 1 Link to comment Share on other sites More sharing options...
marffinn Posted November 15, 2014 Share Posted November 15, 2014 I have a localhost server running just like You specified in getting started guide.i simply try to fire up Your example Phaser game on localhost: function preload() { game.load.image('sky', 'assets/sky.png'); game.load.image('ground', 'assets/platform.png'); game.load.image('star', 'assets/star.png'); game.load.spritesheet('dude', 'assets/dude.png', 32, 48);} And it throws :Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at file:///C:/xampp/htdocs/nodeapps/game/assets/sky.png may not be loaded. What exactly do i have to do to test my own games locally ??? Link to comment Share on other sites More sharing options...
rich Posted November 15, 2014 Share Posted November 15, 2014 This part:file:///C:/xampmeans you just tried to open the html file directly in your browser. It needs serving via xamp. Usually you go to "localhost" in your browser to get the index up. Link to comment Share on other sites More sharing options...
marffinn Posted November 15, 2014 Share Posted November 15, 2014 Yup. That fixed the problem xD. I had xampp running but still i was clicking index.html in the folder and not passsing it through the localhost in my Chrome . Sorry guys... case closed. I have to tell u that I'm starting to love Your Phaser engine <3 Link to comment Share on other sites More sharing options...
Recommended Posts