15.10.2012 Views

Actionscript 3 Entwicklerhandbuch

Actionscript 3 Entwicklerhandbuch

Actionscript 3 Entwicklerhandbuch

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ACTIONSCRIPT 3.0 ENTWICKLERHANDBUCH<br />

Aufrufen und Beenden von AIR-Anwendungen<br />

ActionScript-Beispiel<br />

package<br />

{<br />

import flash.display.Sprite;<br />

import flash.events.InvokeEvent;<br />

import flash.desktop.NativeApplication;<br />

import flash.text.TextField;<br />

public class InvokeEventLogExample extends Sprite<br />

{<br />

public var log:TextField;<br />

public function InvokeEventLogExample()<br />

{<br />

log = new TextField();<br />

log.x = 15;<br />

log.y = 15;<br />

log.width = 520;<br />

log.height = 370;<br />

log.background = true;<br />

}<br />

addChild(log);<br />

NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);<br />

public function onInvoke(invokeEvent:InvokeEvent):void<br />

{<br />

var now:String = new Date().toTimeString();<br />

logEvent("Invoke event received: " + now);<br />

if (invokeEvent.currentDirectory != null)<br />

{<br />

logEvent("Current directory=" + invokeEvent.currentDirectory.nativePath);<br />

}<br />

else<br />

{<br />

Letzte Aktualisierung 27.6.2012<br />

934

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

Saved successfully!

Ooh no, something went wrong!