Loading:


Selection getCaretIndex [AS 2]

Klasa: Selection

Kompatybilność: ActionScript 1.0, Flash 5+

 

public static getCaretIndex() : Number

 

Zwraca index aktualnie świecącego się punktu pozycji.

 

Jeśli nie wyświetla migoczący symbol karetki w polu, wtedy metoda zwraca -1. Porządek zaznaczenia bazują na zerach (więcej info na stronie klasy).

 



Napisz Artyku³

Listing

this.createTextField("pos_txt", this.getNextHighestDepth(), 50, 20, 100, 22);
this.createTextField("tresc_txt", this.getNextHighestDepth(), 50, 50, 400, 300);
tresc_txt.border = true;
tresc_txt.type = "input";
tresc_txt.wordWrap = true;
tresc_txt.multiline = true;
tresc_txt.onChanged = getCaretPos;

var keyListener:Object = new Object();
keyListener.onKeyUp = getCaretPos;
Key.addListener(keyListener);

var mouseListener:Object = new Object();
mouseListener.onMouseUp = getCaretPos;
Mouse.addListener(mouseListener);

function getCaretPos() {
    pos_txt.text = Selection.getCaretIndex();
}




Dodano przez: divix
Ranga: Administrator serwisu Punktów: 38523
Komentarze użytkowników
    • Tre¶æ komentarza
      Kod do komentarza (opcjonalnie)
      PHP JavaScript MySQL Smarty SQL HTML CSS ActionScript
      Autor
      Token
      token

       

       








funkcje.net
Wszelkie prawa zastrzeżone©. | Funkcje.net 2008-2024 v.1.5 | design: diviXdesign & rainbowcolors