vmars316 Posted February 12, 2016 Share Posted February 12, 2016 Hello & Thanks , Code below runs great in Brackets but not online : http://liesandcowpies.com/testMe/vm-phaser/vm-play-music-WEB.html no errors in Chrome . & not on : http://phaser.io/sandbox/obNsxTrv or http://phaser.io/sandbox/obNsxTrv/play Anyone know why ? Thanks . var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'vm-play-music', { preload: preload, create: create, update: update}); // http://liesandcowpies.com/testMe/vm-phaser/vm-play-cowMoo-WEB.html var s; var cowMoo; var onceThru =1; function preload() { // game.load.baseURL = 'http://liesandcowpies.com/testMe/vm-phaser/'; // game.load.crossOrigin = 'anonymous'; game.load.audio('cowmoo', 'CowMoo.mp3'); } function create() { cowMoo = game.sound.add('cowmoo', .5,'false'); cowMoo.play(); } function update() { if (onceThru == 1) { alert('function update() ' + onceThru); collisionLies02(); onceThru = onceThru + 1 ; } } function collisionLies02() { onceThru = onceThru + 1; alert('function collisionLies02() , onceThru = ' + onceThru); // cowMoo = game.sound.add('cowmoo', .5,'false'); cowMoo.play(); } var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'vm-play-music', { preload: preload, create: create, update: update}); // http://liesandcowpies.com/testMe/vm-phaser/vm-play-cowMoo-WEB.html var s; var cowMoo; var onceThru =1; function preload() { // game.load.baseURL = 'http://liesandcowpies.com/testMe/vm-phaser/'; // game.load.crossOrigin = 'anonymous'; game.load.audio('cowmoo', 'CowMoo.mp3'); } function create() { cowMoo = game.sound.add('cowmoo', .5,'false'); cowMoo.play(); } function update() { if (onceThru == 1) { alert('function update() ' + onceThru); collisionLies02(); onceThru = onceThru + 1 ; } } function collisionLies02() { onceThru = onceThru + 1; alert('function collisionLies02() , onceThru = ' + onceThru); // cowMoo = game.sound.add('cowmoo', .5,'false'); cowMoo.play(); } Quote Link to comment Share on other sites More sharing options...
mattstyles Posted February 12, 2016 Share Posted February 12, 2016 Just looks like a url problem. The phaser sandbox isnt going to know where your sound file is and your server would have to be set up to allow serving cross origin even if it did point there (its currently commented out, and most static serving software out-of-the-box does not allow x-origin). Chrome (and all other browsers) should report a 404 or 403 though. Quote Link to comment Share on other sites More sharing options...
vmars316 Posted February 12, 2016 Author Share Posted February 12, 2016 Thanks matt , The actual code in http://phaser.io/sandbox/obNsxTrv/play does have an active link : http://liesandcowpies.com/testMe/vm-phaser/vm-play-music-WEB.html I am confused , why does http://phaser.io/sandbox/obNsxTrv/ or http://phaser.io/sandbox/obNsxTrv/play show empty . What happened to the code ? Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.