is it possible to dispatch some global event that all my objects will ‘hear’? If I use this:
public dynamic class Item extends Sprite {
public function Item() {
this.addEventListener(Event.RESIZE, Global.onResize);
// Global.onResize function isn't called when browser is resized
}
}
Global.onResize function isn’t called when browser is resized, but this will work for any object on stage (even if all of them are Sprites and don’t have timeline:
public dynamic class Item extends Sprite {
public function Item() {
this.addEventListener(Event.ENTER_FRAME, Global.onResize);
// Global.onResize function is called no matter where in Display List object is...
}
}
// I create some kind of structure;
var x = new Item();
stage.addChild(x);
var y = new Item();
x.addChild(y);
// etc....
all I can think of is stopping main timeline and manually dispatching enterFrame event - didn’t try this but seams doable… I can’t find a way to dispatch ‘global event’ that all my objects can listen and react to…