Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 22
  1. #1
    Utente di HTML.it L'avatar di alpeweb
    Registrato dal
    Oct 2002
    Messaggi
    1,691

    [MX] creare campo di testo input

    Non riesco a creare dinamicamente un campo di testo di tipo INPUT.
    eppure sul manuale dice che specificando il tipo di campo si può scegliere. oltretutto dice anche che si può inserire l'opzione
    "autosize" ed "embedfonts" ma pure queste non funzionano.
    Qualcuno ha qualche esempio di campo creato con createtextfield
    con un campo di input magari con autosize ed embedfonts??

    ora adopero un campo di input scrivo il testo e con un pulsante
    dopo aver settato alcune variabili per le caratteristiche del testo
    faccio ciò:

    on (release) {

    x=1;
    y=100;

    _root.gigi.createTextField("stampa2"+i,i,i*2,i*10, 300,50);
    myformat = new TextFormat();
    myformat.color = "0x" add colore;
    myformat.bullet = 1;
    myformat.underline = 0;
    myformat.size=dimensione;
    myformat.italic=0;
    //myformat.align="right";
    myformat.bold=1;
    myformat.leading=1;
    myformat.font=carattere;
    myformat.autoSize=1;
    _root.gigi["stampa2"+i].text = inserito;
    _root.gigi["stampa2"+i].setTextFormat(myformat);
    i++;
    }

    Vorrei evitare il passaggio dal testo di input al campo ganerato
    dinamicamente, richiamando direttamente da un pulsante una funzione
    che mi crea il campo di input dinamico magari in autosize,
    con i caratteri "embed".

    Qualche aiutino??????

  2. #2
    Utente di HTML.it L'avatar di alpeweb
    Registrato dal
    Oct 2002
    Messaggi
    1,691
    ok ho trovato un esempio di rempox
    ora il testo input funziona.
    sinceramente non so dove erravo visto che misembra
    identico a quello che avevo fatto in precedenza.
    forse confondevo le proprieta textfield con quelle di textformat.
    Ora rimane solo un problema:
    mytext.embedFonts=true
    non funziona anzi se è on mi inchioda tutto !!?????
    perchè???????

  3. #3
    Utente di HTML.it L'avatar di alpeweb
    Registrato dal
    Oct 2002
    Messaggi
    1,691
    allora ragazzucci qualcuno saprebbe come mai
    non posso settare "true" l'opzione embedFonts
    sia con campo dinamico che input????????

  4. #4
    Utente di HTML.it
    Registrato dal
    Oct 2002
    Messaggi
    3,023
    Originariamente inviato da alpeweb
    allora ragazzucci qualcuno saprebbe come mai
    non posso settare "true" l'opzione embedFonts
    sia con campo dinamico che input????????
    ho provato anche io e ho visto che

    mytext.embedFonts=false;

    lo accetta...quindi non è un problema di scripting

  5. #5
    Originariamente inviato da alpeweb
    allora ragazzucci qualcuno saprebbe come mai
    non posso settare "true" l'opzione embedFonts
    sia con campo dinamico che input????????
    non ho provato, ma a occhio dovresti gestire un TextFormat con font = "nomeLinkageTesto" ed assegnarlo ad ogni onChanged del campo di input ...
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  6. #6

    assurdo ...

    ... per ora mi viene in mente solo la parola bug, ma visto che l'ultima ovlta che l'ho tirata e' stato a sproposito attendo consiglio dei piu' anziani.

    Guardate questa:
    codice:
    var myFont = new TextFormat();
    myFont.font = "V1"; // linkage del font in library
    
    this.createTextField( "myInput", 1, 10, 10, 200, 20 );
    this["myInput"].border = true;
    this["myInput"].borderColor = 0x000000;
    this["myInput"].type = "input";
    this["myInput"].embedFonts = true;
    this["myInput"].text = " ";
    this["myInput"].setTextFormat(myFont);
    
    this["myInput"].onChanged = function() {
    	this.setTextFormat(myFont);
    }
    se ci clickate col mouse noterete che il cursore lampeggia, ed ovviamente lampeggia con uno spazio vuoto davanti.
    Bene, e allora ???

    E allora provate a scrivere ... nulla ???
    Bene ... ora provate a spostarvi con la freccia della tastiera al di la del primo spazio e riprovate a scrivere ... un input in embedd ??? ... ebbene si.


    Le ho tentate di tutti i colori, non c'e' stato modo di riuscire a dire a quel campo di funzionare normalmente, spero di aver commesso qualche errore perche' senno' la cosa saprebbe quasi di ridicolo ...


    addirittura al posto di

    this["myInput"].text = " ";

    ho messo

    this["myInput"].restrict = "a-z";



    .. ora provate ... funziona subito ma filtra i caratteri . .

    beh ? .. a posto, mettiamo tutti i tag e nessun problema... NO!
    perche' se mettete

    this["myInput"].restrict = "a-zA-Z"; gia' non funzionera' piu' niente.

    Non vi dico quante altre ne ho fatte ma spero che passi qualcuno che si e' gia' ritrovato con questo problema e ce lo risolve
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  7. #7
    Utente di HTML.it L'avatar di alpeweb
    Registrato dal
    Oct 2002
    Messaggi
    1,691
    BOH!!!!
    quello che mi fa impazzire che l'output prodotto
    da un campo testo input con caratteri incorporati
    inserito dal tool e non da script è questo:

    Livello #0:
    Variabile _level0.$version = "WIN 6,0,21,0"
    Variabile _level0.prova = "qwerty"
    Modifica testo: Target="_level0.instance1"
    variable = "prova",
    text = "qwerty",
    htmlText = "qwerty",
    html = false, textWidth = 88, textHeight = 35, maxChars = null,
    borderColor = 0x000000, backgroundColor = 0xFFFFFF,
    textColor = 0x4A4D52, border = true,
    background = true, wordWrap = false, password = false,
    multiline = false,
    selectable = true, scroll = 1, hscroll = 0, maxscroll = 1,
    maxhscroll = 0, bottomScroll = 1,
    type = "input",
    embedFonts = true, restrict = null, length = 6,
    tabIndex = non definito,
    autoSize = "none",
    condenseWhite = false

  8. #8
    sta cosa mi sta facendo diventare piu' scemo di quello che sono ( difficile direte voi, ma e' cosi' )


    ... up
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  9. #9
    ehm .. raga, nessuno sa risolvere sta cosa ??? :master:
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  10. #10
    se nessuno sa niente, se nessuno c'e' mai riuscito, se nessuno ha capito di che cavolo si tratta ...

    Eccovi la soluzione
    Ne derivera' anche una classe dedicata AS2.0, per ora beccatevi questa protitype con tanto di esempio, unico limite e' dato dal fatto che non essendo a tutti gli effetti un campo di input, non c'e' cursore e non c'e' controllo come se lo fosse...

    ... spero di non aver dimenticato tasti perche' vi assicuro che non m'e' passato un attimo ...
    N.B. il CAPSLOCK non l' ho ancora implementato ...


    codice:
    _global.ASCIIconverter = new Object();
    ASCIIconverter["65"] = "a";
    ASCIIconverter["66"] = "b";
    ASCIIconverter["67"] = "c";
    ASCIIconverter["68"] = "d";
    ASCIIconverter["69"] = "e";
    ASCIIconverter["70"] = "f";
    ASCIIconverter["71"] = "g";
    ASCIIconverter["72"] = "h";
    ASCIIconverter["73"] = "i";
    ASCIIconverter["74"] = "j";
    ASCIIconverter["75"] = "k";
    ASCIIconverter["76"] = "l";
    ASCIIconverter["77"] = "m";
    ASCIIconverter["78"] = "n";
    ASCIIconverter["79"] = "o";
    ASCIIconverter["80"] = "p";
    ASCIIconverter["81"] = "q";
    ASCIIconverter["82"] = "r";
    ASCIIconverter["83"] = "s";
    ASCIIconverter["84"] = "t";
    ASCIIconverter["85"] = "u";
    ASCIIconverter["86"] = "v";
    ASCIIconverter["87"] = "w";
    ASCIIconverter["88"] = "x";
    ASCIIconverter["89"] = "y";
    ASCIIconverter["90"] = "z";
    ASCIIconverter["100"] = "4";
    ASCIIconverter["101"] = "5";
    ASCIIconverter["102"] = "6";
    ASCIIconverter["103"] = "7";
    ASCIIconverter["104"] = "8";
    ASCIIconverter["105"] = "9";
    ASCIIconverter["106"] = "*";
    ASCIIconverter["107"] = "+";
    ASCIIconverter["109"] = "-";
    ASCIIconverter["110"] = ".";
    ASCIIconverter["111"] = "/";
    ASCIIconverter["32"] = " ";
    ASCIIconverter["186"] = "è";
    ASCIIconverter["187"] = "+";
    ASCIIconverter["188"] = ",";
    ASCIIconverter["189"] = "-";
    ASCIIconverter["190"] = ".";
    ASCIIconverter["192"] = "ò";
    ASCIIconverter["193"] = "à";
    ASCIIconverter["194"] = "ù";
    ASCIIconverter["219"] = "'";
    ASCIIconverter["220"] = "\\";
    ASCIIconverter["221"] = "ì";
    ASCIIconverter["48"] = "0";
    ASCIIconverter["49"] = "1";
    ASCIIconverter["50"] = "2";
    ASCIIconverter["51"] = "3";
    ASCIIconverter["52"] = "4";
    ASCIIconverter["53"] = "5";
    ASCIIconverter["54"] = "6";
    ASCIIconverter["55"] = "7";
    ASCIIconverter["56"] = "8";
    ASCIIconverter["57"] = "9";
    ASCIIconverter["96"] = "0";
    ASCIIconverter["97"] = "1";
    ASCIIconverter["98"] = "2";
    ASCIIconverter["99"] = "3";
    TextField.prototype.inputListener = function( myEmbedFont ) {
    	// andr3a 13/01/2004
    	this.myEmbedFontsInput = new Object();
    	this.myEmbedFontsInput.selectionPath = this;
    	this.myEmbedFontsInput.shiftPushed = false;
    	this.myEmbedFontsInput.altGrPushed = false;
    	this.myEmbedFontsInput.onKeyDown = function() {
    		if( String( Selection.getFocus() ) == String( this.selectionPath ) ) {
    			if( Key.getCode() == 8 && this.selectionPath.text.length > 0 ) {
    				var nowLength = new Number( this.selectionPath.text.length );
    				this.selectionPath.text = this.selectionPath.text.substring( 0, ( nowLength-1 ) );
    			}
    			else if( Key.getCode() == 188 && this.shiftPushed == true ) {
    				this.selectionPath.text += ";";
    			}
    			else if( Key.getCode() == 190 && this.shiftPushed == true ) {
    				this.selectionPath.text += ":";
    			}
    			else if( Key.getCode() == 189 && this.shiftPushed == true ) {
    				this.selectionPath.text += "_";
    			}
    			else if( Key.getCode() == 194 && this.shiftPushed == true ) {
    				this.selectionPath.text += "§";
    			}
    			else if( Key.getCode() == 193 && this.shiftPushed == true ) {
    				this.selectionPath.text += "°";
    			}
    			else if( Key.getCode() == 192 && this.shiftPushed == true ) {
    				this.selectionPath.text += "ç";
    			}
    			else if( Key.getCode() == 187 && this.altGrPushed == true ) {
    				this.selectionPath.text += "]";
    			}
    			else if( Key.getCode() == 187 && this.shiftPushed == true ) {
    				this.selectionPath.text += "*";
    			}
    			else if( Key.getCode() == 186 && this.altGrPushed == true ) {
    				this.selectionPath.text += "[";
    			}
    			else if( Key.getCode() == 186 && this.shiftPushed == true ) {
    				this.selectionPath.text += "é";
    			}
    			else if( Key.getCode() == 221 && this.shiftPushed == true ) {
    				this.selectionPath.text += "^";
    			}
    			else if( Key.getCode() == 220 && this.shiftPushed == true ) {
    				this.selectionPath.text += "|";
    			}
    			else if( Key.getCode() == 57 && this.shiftPushed == true ) {
    				this.selectionPath.text += ")";
    			}
    			else if( Key.getCode() == 56 && this.shiftPushed == true ) {
    				this.selectionPath.text += "(";
    			}
    			else if( Key.getCode() == 55 && this.shiftPushed == true ) {
    				this.selectionPath.text += "/";
    			}
    			else if( Key.getCode() == 54 && this.shiftPushed == true ) {
    				this.selectionPath.text += "&";
    			}
    			else if( Key.getCode() == 53 && this.shiftPushed == true ) {
    				this.selectionPath.text += "%";
    			}
    			else if( Key.getCode() == 52 && this.shiftPushed == true ) {
    				this.selectionPath.text += "$";
    			}
    			else if( Key.getCode() == 51 && this.shiftPushed == true ) {
    				this.selectionPath.text += "£";
    			}
    			else if( Key.getCode() == 50 && this.shiftPushed == true ) {
    				this.selectionPath.text += '"';
    			}
    			else if( Key.getCode() == 48 && this.shiftPushed == true ) {
    				this.selectionPath.text += "=";
    			}
    			else if( Key.getCode() == 219 && this.shiftPushed == true ) {
    				this.selectionPath.text += "?";
    			}
    			else if( Key.getCode() == 49 && this.shiftPushed == true ) {
    				this.selectionPath.text += "!";
    			}
    			else if( Key.getCode() != 8 && ASCIIconverter[Key.getCode()] != undefined ) {
    				var entryText = this.shiftPushed == true ? ASCIIconverter[Key.getCode()].toUpperCase() : ASCIIconverter[Key.getCode()];
    				this.selectionPath.text += entryText;
    			}
    			else if( Key.getCode() == 16 && this.shiftPushed == false ) {
    				this.shiftPushed = true;
    			}
    			else if( Key.getCode() == 18 && this.altGrPushed == false ) {
    				this.altGrPushed = true;
    			}
    			this.selectionPath.setTextFormat( myEmbedFont );
    		}
    	}
    	this.myEmbedFontsInput.onKeyUp = function() {
    		if( Key.getCode() == 16 ) {
    			this.shiftPushed = false;
    		}
    		else if( Key.getCode() == 18 ) {
    			this.altGrPushed = false;
    		}
    	}
    	Key.addListener( this.myEmbedFontsInput );
    }
    
    
    
    var myFont = new TextFormat();
    myFont.font = "V1"; // linkage del font in library
    this.createTextField( "myInput", 1, 10, 10, 200, 20 );
    this["myInput"].border = true;
    this["myInput"].borderColor = 0x000000;
    this["myInput"].embedFonts = true;
    this["myInput"].inputListener( myFont );
    
    this.createTextField( "myInput2", 2, 10, 40, 200, 20 );
    this["myInput2"].border = true;
    this["myInput2"].borderColor = 0x000000;
    this["myInput2"].embedFonts = true;
    this["myInput2"].inputListener( myFont );

    saluti
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.