LTextEvent Class
LTextEvent オブジェクトは、ユーザーがテキストフィールドにテキストを入力するか、HTML 対応のテキストフィールドのハイパーリンクをクリックしたときに、オブジェクトによって送出されます。 次の 2 種類のテキストイベントがあります。LTextEvent.TEXT_INPUT および TextEvent.WIND_COMPLETE。
Constructor
LTextEvent
()
public
Item Index
Properties
- TEXT_INPUT static
- WIND_COMPLETE static
Properties
TEXT_INPUT
String
public
static
[静的] textInput イベントオブジェクトの type プロパティ値を定義します。
このイベントには、次のプロパティがあります。
属性 | 值 |
---|---|
currentTarget | イベントリスナーで Event オブジェクトをアクティブに処理しているオブジェクトです。 |
target | このイベントにcurrentTargetと同じです. |
eventType | クリックされたハイパーリンクを含むテキストフィールドです。 |
keyCode | イベントを引き起こしたキーのUnicodeを指定する。 |
preventDefault() | イベントをキャンセルする |
Example:
LInit(50, "legend", 800, 480, main);
function main () {
LGlobal.setDebug(true);
var theTextField = new LTextField();
theTextField.x = 20;
theTextField.y = 20;
theTextField.setType(LTextFieldType.INPUT);
addChild(theTextField);
theTextField.addEventListener(LTextEvent.TEXT_INPUT, textinput);
}
function textinput(event){
trace("event.keyCode=" + event.keyCode);
}
WIND_COMPLETE
String
public
static
[静的] textInput イベントオブジェクトの type プロパティ値を定義します。
このイベントには、次のプロパティがあります。
属性 | 值 |
---|---|
currentTarget | イベントリスナーで Event オブジェクトをアクティブに処理しているオブジェクトです。 |
target | このイベントにcurrentTargetと同じです. |
Example:
LInit(50, "legend", 800, 480, main);
function main () {
LGlobal.setDebug(true);
var theTextField = new LTextField();
theTextField.x = 20;
theTextField.y = 20;
addChild(theTextField);
theTextField.text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
theTextField.speed = 2;
theTextField.addEventListener(LTextEvent.WIND_COMPLETE, windComplete);
theTextField.wind();
}
function windComplete(event){
trace("windComplete","event.currentTarget = " + event.currentTarget);
}