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 />

Tastatureingabe<br />

package {<br />

import flash.display.MovieClip;<br />

import flash.events.SoftKeyboardEvent;<br />

import flash.events.Event;<br />

import flash.display.StageScaleMode;<br />

import flash.display.StageAlign;<br />

import flash.display.InteractiveObject;<br />

import flash.text.TextFieldType;<br />

import flash.text.TextField;<br />

public class PanningExample extends MovieClip {<br />

private var textField:TextField = new TextField();<br />

public function PanningExample() {<br />

this.stage.scaleMode = StageScaleMode.NO_SCALE;<br />

this.stage.align = StageAlign.TOP_LEFT;<br />

textField.y = this.stage.stageHeight - 201;<br />

textField.width = this.stage.stageWidth;<br />

textField.height = 200;<br />

textField.type = TextFieldType.INPUT;<br />

textField.border = true;<br />

textField.wordWrap = true;<br />

textField.multiline = true;<br />

this.addChild( textField );<br />

//track soft keyboard and stage resize events<br />

textField.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE,<br />

onKeyboardChange );<br />

textField.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE,<br />

onKeyboardChange );<br />

this.stage.addEventListener( Event.RESIZE, onDisplayAreaChange );<br />

}<br />

private function onDisplayAreaChange( event:Event ):void<br />

{<br />

textField.y = this.stage.stageHeight - 201;<br />

Letzte Aktualisierung 27.6.2012<br />

607

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

Saved successfully!

Ooh no, something went wrong!