Comunidad de diseño web y desarrollo en internet online

Detectar Resolucion de Pantalla AS3

Citar            
MensajeEscrito el 14 Dic 2009 07:38 am
Hola, Muy buenas. Mi intencion es detectar la resolucion del escritorio para que mi aplicacion AIR se centre en el escritorio. bueno espero que exista algo saludos y gracias.

Por troyar

48 de clabLevel



 

msie7
Citar            
MensajeEscrito el 14 Dic 2009 10:10 am
En Flex existe

Código ActionScript :

flash.system.Capabilities.screenResolutionX;
flash.system.Capabilities.screenResolutionY;


No se si en air te funcionará

Por ur!

256 de clabLevel



 

Barcelona

chrome
Citar            
MensajeEscrito el 14 Dic 2009 10:43 am
Hola,
también puedes usar bounds y visibleBounds de la clase Screen.
Con bounds puedes centrar la aplicación en la pantalla:

Código ActionScript :

stage.nativeWindow.x = (Screen.mainScreen.bounds.width - stage.nativeWindow.width) / 2;
stage.nativeWindow.y = (Screen.mainScreen.bounds.height - stage.nativeWindow.height) / 2;

Y con visibleBounds puedes centrarla en el área visible de la pantalla (excluyendo la barra de tareas en Windows, o el dock en Mac):

Código ActionScript :

stage.nativeWindow.x = (Screen.mainScreen.visibleBounds.width - stage.nativeWindow.width) / 2;
stage.nativeWindow.y = (Screen.mainScreen.visibleBounds.height - stage.nativeWindow.height) / 2;

Por isidoro

Claber

498 de clabLevel

2 tutoriales

Genero:Masculino  

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.