15.10.2012 Views

Actionscript 3 Entwicklerhandbuch

Actionscript 3 Entwicklerhandbuch

Actionscript 3 Entwicklerhandbuch

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ACTIONSCRIPT 3.0 ENTWICKLERHANDBUCH<br />

Anzeigebildschirme in AIR<br />

private function moveRight():void{<br />

var currentScreen:Screen = getCurrentScreen();<br />

var left:Array = Screen.screens;<br />

left.sort(sortHorizontal);<br />

for(var i:int = left.length - 1; i > 0; i--){<br />

if(left[i].bounds.left > stage.nativeWindow.bounds.left){<br />

stage.nativeWindow.x +=<br />

left[i].bounds.left - currentScreen.bounds.left;<br />

stage.nativeWindow.y += left[i].bounds.top - currentScreen.bounds.top;<br />

}<br />

}<br />

}<br />

private function moveUp():void{<br />

var currentScreen:Screen = getCurrentScreen();<br />

var top:Array = Screen.screens;<br />

top.sort(sortVertical);<br />

for(var i:int = 0; i < top.length - 1; i++){<br />

if(top[i].bounds.top < stage.nativeWindow.bounds.top){<br />

stage.nativeWindow.x += top[i].bounds.left - currentScreen.bounds.left;<br />

stage.nativeWindow.y += top[i].bounds.top - currentScreen.bounds.top;<br />

break;<br />

}<br />

}<br />

}<br />

private function moveDown():void{<br />

var currentScreen:Screen = getCurrentScreen();<br />

}<br />

var top:Array = Screen.screens;<br />

top.sort(sortVertical);<br />

for(var i:int = top.length - 1; i > 0; i--){<br />

if(top[i].bounds.top > stage.nativeWindow.bounds.top){<br />

stage.nativeWindow.x += top[i].bounds.left - currentScreen.bounds.left;<br />

stage.nativeWindow.y += top[i].bounds.top - currentScreen.bounds.top;<br />

break;<br />

}<br />

}<br />

private function sortHorizontal(a:Screen,b:Screen):int{<br />

if (a.bounds.left > b.bounds.left){<br />

return 1;<br />

} else if (a.bounds.left < b.bounds.left){<br />

Letzte Aktualisierung 27.6.2012<br />

979

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!