Visualizzazione dei risultati da 1 a 8 su 8
  1. #1

    [04] Componente Alert

    Ciao a tutti

    sto provando l'esempio di macromedia sul componente alert ma non capisco perchč non vā

    codice:
    myClickAlert = function(evt){
      if(evt.detail == Alert.OK){
        trace(Alert.okLabel);
    	_root.mess.text ="OK";
      }else if (evt.detail == Alert.CANCEL){
    	_root.mess.text = "CANCEL";
    	  trace(Alert.cancelLabel);
      }
    }
    import mx.controls.Alert
    Alert.show("Questa č una prova di errori", "Errore", Alert.OK | Alert.CANCEL, this, myClickAlert);
    dovrei intercettare il tasto OK o Cancel e scrivere il valore su una variabile sulla root

    perchč non vā??

  2. #2
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    codice:
    import mx.controls.Alert;
    
    myClickAlert = function (evt)
    {
    	if (evt.detail == Alert.OK) {
    		trace(Alert.okLabel);
    		_root.mess.text = "OK";
    	} else if (evt.detail == Alert.CANCEL) {
    		_root.mess.text = "CANCEL";
    		trace(Alert.cancelLabel);
    	}
    };
    Alert.show("Questa č una prova di errori", "Errore", Alert.OK | Alert.CANCEL, this, myClickAlert);
    L'import devi metterlo in cima...

  3. #3
    scusa ho provato ma mi blocca lo script mi appare un messaggio che mi consiglia di interrompere lo script

    codice:
    Stage.scaleMode = "noscale";
    import mx.controls.Alert
    Selection.setFocus("Nome"); // perchč non setta il fuoco??
    // verifica
    inserimento.onRelease = function() {
        myVars = new LoadVars();
        myVars.Nome = Nome.text;
        myVars.onLoad = function(success) {
            if (success) {
                inserimento.enabled = false;
                Nome.text = "Nome";
                if (this.vailda) {
    				myClickAlert = function (evt)
    				{
    				if (evt.detail == Alert.OK) {
    				trace(Alert.okLabel);
    				_root.mess.text = "OK";
    				} else if (evt.detail==Alert.CANCEL){_root.mess.text = "CANCEL";trace(Alert.cancelLabel);
    }
    };
    
    Alert.show(this.errorMsg, "ATTENZIONE!!", Alert.OK | Alert.CANCEL, this, myClickAlert);
    
    				// condizione per Alert
                }
            } else {
                Alert.show("Non č stato possibile inserire i dati - Contattare l'aministatore", "ATTENZIONE!!", Alert.OK);
            }
        };
        myVars.sendAndLoad("http://localhost/miofile.php", myVars, "POST");
    };

  4. #4
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    codice:
    import mx.controls.Alert;
    
    Stage.scaleMode = "noscale";
    Selection.setFocus("Nome");
    // perchč non setta il fuoco??
    // verifica
    
    myClickAlert = function (evt)
    {
    	if (evt.detail == Alert.OK) {
    		trace(Alert.okLabel);
    		_root.mess.text = "OK";
    	} else if (evt.detail == Alert.CANCEL) {
    		_root.mess.text = "CANCEL";
    		trace(Alert.cancelLabel);
    	}
    };
    				
    inserimento.onRelease = function()
    {
    	var myVars = new LoadVars();
    	var path = this._parent;
    	myVars.Nome = Nome.text;
    	myVars.onLoad = function(success)
    	{
    		if (success) {
    			inserimento.enabled = false;
    			Nome.text = "Nome";
    			if (this.vailda) {
    				Alert.show(this.errorMsg, "ATTENZIONE!!", Alert.OK | Alert.CANCEL, path, myClickAlert);
    			}
    		} else {
    			Alert.show("Non č stato possibile inserire i dati - Contattare l'aministatore", "ATTENZIONE!!", Alert.OK);
    		}
    	};
    	myVars.sendAndLoad("http://localhost/miofile.php", myVars, "POST");
    };

  5. #5
    Grazie mille!!!

    posso chiederti un'ultima cosa...

    perche non mi setta il fuoco sul campo di testo input che ho sullo stage??

    codice:
    Selection.setFocus("Nome");// perchč non setta il fuoco??
    uso il componente TextInput con nome d'istanza "Nome" io vorrei che quello che č scritto al suo interno fosse completamente selezionato in modo che quando inizio a scrivere si cancelli

    ps: fai dei corsi come insegnante??

    Sei grande!!

  6. #6
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    Usa:
    codice:
    focusManager.setFocus(Nome)
    >ps: fai dei corsi come insegnante??

    Quelli di Html.it, Flash MX Developer e Flash MX Designer.. :)

  7. #7
    come posso prendere informazioni sulle date e i costi, io perō sono abruzzese....

    cmq in che cittā fate i corsi

    PS: voglio te come insegnante altrimenti non vengo!!!


  8. #8
    Originariamente inviato da negatyve
    Usa:
    codice:
    focusManager.setFocus(Nome)
    non mi funziona... dove sto sbagliando

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 © 2025 vBulletin Solutions, Inc. All rights reserved.