actionscript 3 - Sprite not displaying in as3 -


i have class in game tells sprite spawn, class movieclip code attached it. call spawn() function on class , draw sprite using graphics api it. spawn function follows:

public function spawn(){         this.addchild(window)         window.x = 5         window.y = 10         window.width = this.width - 10         window.height = this.height - 10         window.graphics.clear()         window.graphics.drawrect(5, 10, this.width - 10, this.height - 20)         window.graphics.beginfill(0xffffff, 1)         trace(window.visible) } 

the problem child window doesn't appear, despite visible trace returning true. in advance help!

try :

window.graphics.clear() window.graphics.beginfill(0xffffff, 1) window.graphics.drawrect(5, 10, this.width - 10, this.height - 20) window.graphics.endfill(); 

and make sure class add window on stage.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -