Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Sequenza controllo if.

  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2001
    Messaggi
    144

    Sequenza controllo if.

    onClipEvent (enterFrame) {
    finelargh = 525;
    iniziolargh = aa;
    }
    onClipEvent (enterFrame) {
    if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
    _root.foto="uno";
    }
    }
    onClipEvent (enterFrame) {
    iniziolargh = aa;
    if (_root.foto=="uno"){
    if (i++ == 10) {
    finelargh = 525;
    i = 0;
    }
    _width += (finelargh-_width)/frame;
    }

    if (_root.foto=="zero"){
    aa=181;
    _width += (iniziolargh-_width)/frame;
    }

    if (_root.foto=="due" or _root.foto=="tre"){
    aa=135;
    _width += (iniziolargh-_width)/frame;
    }

    if (_root.foto=="quattro"){
    aa=41;
    _width += (iniziolargh-_width)/frame;
    }

    }

    onClipEvent (load) {
    frame = 10;
    i = 0;
    _root.foto="zero";
    }


    Messo così secondo voi è possibile che controlli solo il primo if e poi non vada più avanti?

  2. #2
    Utente di HTML.it
    Registrato dal
    Oct 2004
    Messaggi
    438
    codice:
    onClipEvent (enterFrame) {
    	finelargh = 525;
    	iniziolargh = aa;
    }
    onClipEvent (enterFrame) {
    	if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
    	_root.foto="uno";
    	}
    }
    onClipEvent (enterFrame) {
    	iniziolargh = aa;
    	if (_root.foto=="uno"){
    		if (i++ == 10) {
    			finelargh = 525;
    			i = 0;
    		}
    		_width += (finelargh-_width)/frame;
    	}
    	
    	else if (_root.foto=="zero"){
    		aa=181;
    		_width += (iniziolargh-_width)/frame;
    	}
    	
    	else if (_root.foto=="due" or _root.foto=="tre"){
    		aa=135;
    		_width += (iniziolargh-_width)/frame;
    	}
    	
    	else if (_root.foto=="quattro"){
    		aa=41;
    		_width += (iniziolargh-_width)/frame;
    	}
    
    }
    
    onClipEvent (load) {
    	frame = 10;
    	i = 0;
    	_root.foto="zero";
    }
    prova cosi....

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2001
    Messaggi
    144
    Niente, continua a non andare.

    Praticamento ho 4 (uno, due, tre e quattro) mc con lo stesso script che varia solo il riferimento suo. Non ben capito il motivo ma funzionano solo quelli a sinistra di ognuno e a destra no.

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.