+ Reply to Thread
Results 1 to 7 of 7

completamento automatico

This is a discussion on completamento automatico within the Siti Flash forums, part of the Flash Italiano category; salve a tutti....io ho un problemino,ho una riga di testo chiamata myText_txt (di imput) e sotto una riga di testo ...

  1. #1
    Junior Member Settled In hotless is on a distinguished road
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    completamento automatico

    salve a tutti....io ho un problemino,ho una riga di testo chiamata myText_txt (di imput) e sotto una riga di testo chiamata complete_txt sulla quale visualizzo il suggerimento della parola da completare e che se è giusta,seleziono con il tasto ctrl...il problema è questo:
    invece di immettere la parola nel myText_txt,dovrei inviargli le lettere con un pulsante che gli invia una lettera alla volta (purtroppo l'utente può muovere solo un pollice per premere un tasto,per il resto è totalmente paralizzato)...ci ho provato inviandogli il valore di una variabile,ma mi visualizza le lettere ma non il suggerimento,questo è il codice...se qualcuno mi può aiutare farebbe proprio del bene a quel povero ragazzo




    function autoComplete( ) {
    if (Key.isDown(Key.CONTROL)) {
    myText_txt.text = complete_txt.text + " ";
    Selection.setSelection(myText_txt.text.length,
    myText_txt.text.length);
    }
    }
    function fieldChange( ) {
    match = "";
    startOfWord = this.text.lastIndexOf(" ") + 1;
    lastWord = this.text.substring(startOfWord, this.text.length);
    if (lastWord.length > 1) {
    for (var i = 0; i < dictionary.length; i++) {
    if (lastWord == (dictionary[i].substr(0, lastWord.length))) {
    match = dictionary[i];
    search = i;
    break;
    }
    }
    } else {
    search = 0;
    }
    complete_txt.text = this.text.substr(0, startOfWord) + match;
    }
    var myText:String = "parole...bla,bla,bla,bla... ";
    var dictionary:Array = new Array( );
    var search:Number = 0;
    var lastWord:String = "";
    var startOfWord:String = "";
    var control:Object = new Object( );
    dictionary = myText.split(" ");
    dictionary.sort( );
    myText_txt.onChanged = fieldChange;
    control.onKeyDown = autoComplete;
    Key.addListener(control);


    grazie in anticipo

  2. #2
    Junior Member Settled In hotless is on a distinguished road
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Re: completamento automatico

    secondo me il problema è la penultima riga,cioè "control.onKeyDown = autoComplete;" che comanda il tutto alla pressione di un tasto,qualcuno sa come posso comandarlo con la variazione della variabile?

  3. #3
    Junior Member Settled In hotless is on a distinguished road
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Re: completamento automatico

    complimenti per l'aiuto che mi state dando,veramente un bel forum,non c'è che dire

  4. #4
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,762
    Rep Power
    11

    Re: completamento automatico

    hotless purtroppo in questo momento io nn posso seguirti, spero ci sia qualcuno nella community in grado di aiutarti... ovviamente questo è un bel forum senz'altro! ;)

  5. #5
    Junior Member Settled In hotless is on a distinguished road
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Re: completamento automatico

    ok aspetto..

  6. #6
    Junior Member Settled In hotless is on a distinguished road
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Re: completamento automatico

    nessun bravo bimbo che vuole fare una buona azione?

  7. #7
    Junior Member Settled In hotless is on a distinguished road
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Re: completamento automatico

    flep invoco il tuo aiuto!!!

+ Reply to Thread

Similar Threads

  1. Delay ed attesa completamento in as3
    By Tabani in forum Actionscript 3.0 avanzato
    Replies: 2
    Last Post: 23-06-11, 12:59
  2. Replies: 3
    Last Post: 16-04-11, 03:44
  3. return dopo il completamento di un evento
    By beceku in forum Actionscript 3.0 base
    Replies: 0
    Last Post: 23-12-08, 09:12
  4. attesa completamento Filmato e poi load
    By raziel1973 in forum Actionscript 3.0 avanzato
    Replies: 10
    Last Post: 26-08-08, 07:37
  5. REdirect automatico
    By looollli in forum Flash Italiano
    Replies: 1
    Last Post: 26-05-08, 14:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts