This is a translated page. The original can be found here: http://www.designscripting.com/2009/06/center-an-adobe-air-application-on-screen/
Home » AIR , ActionScript 3.0 Hjem » AIR , ActionScript 3.0

Center an Adobe AIR application on Screen Center et Adobe AIR-applikasjon på skjermen

21 June 2009 21 juni 2009 2 Comments 2 Kommentarer

By default NativeWindow loads some where on the screen. Som standard NativeWindow laster enkelte hvor på skjermen. Loading an splash screen or application on center of the screen will gives better user experience. Laster en splash-skjerm eller søknad på midten av skjermen vil gi bedre brukeropplevelse.

Below code we are creating a native window and aligning in the screen center. Nedenfor koden vi å lage en ekte vindu og rette i skjermen sentrum.

 var _splashWindow:NativeWindow = new NativeWindow(nativeWindowOptions); var _splashWindow: NativeWindow = nye NativeWindow (nativeWindowOptions);

_splashWindow.width = 484; _splashWindow.width = 484;

_splashWindow.height = 289; _splashWindow.height = 289;

_splashWindow.stage.align = "TL"; _splashWindow.stage.align = "TL";

_splashWindow.stage.scaleMode = "noScale"; _splashWindow.stage.scaleMode = "noScale";

_splashWindow.title = "Center on screen"; _splashWindow.title = "Center på skjermen";
var screenBounds:Rectangle = Screen.mainScreen.bounds; var screenBounds: rektangel = Screen.mainScreen.bounds;

_splashWindow.x = (screenBounds.width - _splashWindow.width)/2; _splashWindow.x = (screenBounds.width - _splashWindow.width) / 2;

_splashWindow.y = (screenBounds.height - _splashWindow.height)/2; _splashWindow.y = (screenBounds.height - _splashWindow.height) / 2;
_splashWindow.activate(); _splashWindow.activate (); 

Here, Her

 var screenBounds:Rectangle = Screen.mainScreen.bounds; var screenBounds: rektangel = Screen.mainScreen.bounds; 

Screen.mainScreen.bounds return the screen boundary. Screen.mainScreen.bounds tilbake på skjermen grensen.

 _splashWindow.x = (screenBounds.width - _splashWindow.width)/2; _splashWindow.x = (screenBounds.width - _splashWindow.width) / 2;

_splashWindow.y = (screenBounds.height - _splashWindow.height)/2; _splashWindow.y = (screenBounds.height - _splashWindow.height) / 2; 

Centering the application on screen. Sentrering programmet på skjermen.

VN:F [1.7.7_1013] VN: F [1.7.7_1013]
Rating: 0.0/ 10 (0 votes cast) Vurdering: 0,0 / 10 (0 stemmer cast)
VN:F [1.7.7_1013] VN: F [1.7.7_1013]
Rating: 0 (from 0 votes) Vurdering: 0 (fra 0 stemmer)
Translate this post Oversett dette innlegget




Leave your response! Avreise svaret ditt!

Add your comment below, or trackback from your own site. Legg inn din kommentar nedenfor, eller styrekule fra din egen sted. You can also subscribe to these comments via RSS. Du kan også abonnere på disse kommentarene via RSS.

Be nice. Vær hyggelig. Keep it clean. Holde den ren. Stay on topic. Opphold på emnet. No spam. Ingen spam.

You can use these tags: Du kan bruke disse kodene:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. Dette er en Gravatar-aktivert weblog. To get your own globally-recognized-avatar, please register at Gravatar . For å få ditt eget globalt-gjenkjent-avatar, kan du registrere deg på Gravatar .

CAPTCHA Image
Oppdater bilde