defiraid Posted November 3, 2018 Share Posted November 3, 2018 Hi, i can't remove the video with video.destroy. It stop it but, it stay on screen. window.onload = function() { var game = new Phaser.Game(674, 520, Phaser.AUTO, '', { preload : preload }); var aide2; function preload() { game.load.onLoadComplete.add(create, this); game.load.atlasJSONArray('closeAide', 'assets/images/closeAide.png','assets/images/closeAide.json'); game.load.video('aide','assets/video/wormhole.mp4'); } function create() { aide = game.add.video('aide'); aide.play(true); aide.addToWorld(); closeAide = game.add.button(20, 20, 'closeAide',clicCloseAide); } function clicCloseAide() { aide.destroy(); closeAide.destroy(); } } the video is available here : https://phaser.io/examples/v2/video/play-video thanks for your help Link to comment Share on other sites More sharing options...
samme Posted November 4, 2018 Share Posted November 4, 2018 var aide, aideImg; function create() { aide = game.add.video('aide'); aide.play(true); aideImg = aide.addToWorld(); closeAide = game.add.button(20, 20, 'closeAide',clicCloseAide); } function clicCloseAide() { aideImg.destroy(); aide.destroy(); closeAide.destroy(); } Link to comment Share on other sites More sharing options...
Recommended Posts