I'm having difficulties with click event after adding some child :Loader
instances in it.
var wr:Sprite=new Sprite();
stage.addChild(wr);
wr.graphics.drawRect(0,0,stage.width,stage.height);
wr.width=stage.width;
wr.height=stage.height;
wr.addEventListener('click',function():void{
log('CLICKED!');
});
wr.addChild(el.sprite);
Problem is that click event is only working when i'm clicking on el.sprite
, but when i'm clicking anywhere on the stage, it's not working(not triggering click event).
Why would it do that? Haven't i stretched wr
layer on the whole stage?
What i'm missing or doesn't understand in flash DisplayObject list mechanics?
I'm trying to position el.sprite(pause button) on the center of wr(pause layer) and apply click event on the whole wr layer(whole stage).
I'm developing video player. :)