I’ve had to answer this at least three times in the last month so I’m assuming it’s a useful piece of code.
When creating liquid interfaces in ActionScript 2 you simply let your object listen to the stage for changes, like so:
1 2 3 4 5 6 7 | Stage.addListener(this); ... private function onResize() { this.mc_background._y = Stage.height } |
In ActionScript 3 the stage is accessible as a property in all classes inheriting from DisplayObject. Useful, but here is where the trouble begins for most people. If you…