how to detect screen resolution changes dynamically in adobe AIR
Screen class in actionscript provides the latest total screen bounds and available screen bound, but doesn't allow to attach listener to listen for changes on runtime.
is there any way of detecting screen resolution changes on runtime, it is required to size the application whenever screen resolution is changed. e.g. in case when machine display i开发者_Go百科s connected to projector/high resolution monitor and then switched back to normal.
thanks,
There are several solutions:
- If your window is maximized, you can listen to any of various RESIZE events (see you comp. events list)
- You can create invisible maximized window and listen to it's resize event
- You can check screen resolution on timer (e.g. every 1 second). It will not decrease the performance.
精彩评论