Cary Crusiau Posted April 11, 2014 Report Share Posted April 11, 2014 Hi there, In your 'Flying Dog' game, how can I call the plane ('this.sprite' in objects.js file) from a function within the scenes.js file? TIA Link to comment Share on other sites More sharing options...
enpu Posted April 11, 2014 Report Share Posted April 11, 2014 Do you mean like this:Player = game.Class.extend({ init: function() { this.sprite = new game.Sprite('player.png'); }});SceneGame = game.Scene.extend({ init: function() { this.player = new Player(); this.player.sprite.position.set(200, 200); }}); Link to comment Share on other sites More sharing options...
Cary Crusiau Posted April 11, 2014 Author Report Share Posted April 11, 2014 Exactly! I already tried 'this.player.sprite' but I didn't know I had to create a new Player(). Thank you very much! Link to comment Share on other sites More sharing options...
Cary Crusiau Posted April 14, 2014 Author Report Share Posted April 14, 2014 Ok, this create a new instance of the plane. What I want to do is to stop the MovieClip (already created in Player) from SceneGame. Something like this.player.sprite.stop(); TIA Link to comment Share on other sites More sharing options...
Recommended Posts