How to detect Screen width/height change in Flex -
i have objects placed on screen using x/y coordinates. want way update based on changes in screen width/height. if used re-sized browser window x/y should change. how cick off function every time screen re-sized.
you can attaching resizeevent listener whatever object want track:
http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/mx/events/resizeevent.html
public class main extends sprite { public function main ( ) { stage.addeventlistener(event.resize, resizelistener); } private function resizelistener (e:event):void { trace("the application window changed size!"); trace("new width: " + stage.stagewidth); trace("new height: " + stage.stageheight); } }
Comments
Post a Comment