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

    oggetto che segue il mouse.....

    ciao
    dovrei creare un menu come quello di sto sito http://www.irial.it,ovvero con un oggetto(in qst caso una L rovesciata)che segue il mouse ma che si ferma in precisi punti(le voci del menu).
    qualcuno sa l'action script che devo usare????

  2. #2
    Ciao Maz3us,creati i bottoni del menu ed istanziali 'mc1','mc2','mc3','mc4', creati l'oggetto che deve seguire il mouse e istanzialo 'riquadro', poi sul frame metti:

    codice:
    function tuttoComePrima() {
    	pos = _root.menuCliccato._x;
    	larg = _root.menuCliccato._width;
    	delete riquadro.onEnterFrame;
    	riquadro.onEnterFrame = function(){
    		this._x = this._x+(pos-this._x)/7;
    		if (pos == Math.round(this._x)) {
    			this._x = pos;
    			delete this.onEnterFrame;
    		}
    	};
    	clearInterval(a);
    }
    _root.menuCliccato = mc1;
    tuttoComePrima();
    
    mc1.onRollOver = function() {
    	clearInterval(a);
    	pos = this._x;
    	delete this.onEnterFrame;
    	riquadro.onEnterFrame = function() {
    		this._x = this._x+(pos-this._x)/7;
    		if (pos == Math.round(this._x)) {
    			this._x = pos;
    			delete this.onEnterFrame;
    		}
    	};
    };
    mc1.onRollOver = function() {
    	clearInterval(a);
    	pos = this._x;
    	delete this.onEnterFrame;
    	riquadro.onEnterFrame = function() {
    		this._x = this._x+(pos-this._x)/7;
    		if (pos == Math.round(this._x)) {
    			this._x = pos;
    			delete this.onEnterFrame;
    		}
    	};
    };
    mc1.onRollOut = function() {
    	a = setInterval(tuttoComePrima, 2000);
    };
    mc1.onRelease = function(){
    	_root.menuCliccato = this;
    }
    mc2.onRollOver = function() {
    	clearInterval(a);
    	pos = this._x;
    	delete this.onEnterFrame;
    	riquadro.onEnterFrame = function() {
    		this._x = this._x+(pos-this._x)/7;
    		if (pos == Math.round(this._x)) {
    			this._x = pos;
    			delete this.onEnterFrame;
    		}
    	};
    };
    mc2.onRollOut = function() {
    	a = setInterval(tuttoComePrima, 2000);
    };
    mc2.onRelease = function(){
    	_root.menuCliccato = this;
    }
    mc3.onRollOver = function() {
    	clearInterval(a);
    	pos = this._x;
    	delete this.onEnterFrame;
    	riquadro.onEnterFrame = function() {
    		this._x = this._x+(pos-this._x)/7;
    		if (pos == Math.round(this._x)) {
    			this._x = pos;
    			delete this.onEnterFrame;
    		}
    	};
    };
    mc3.onRollOut = function() {
    	a = setInterval(tuttoComePrima, 2000);
    };
    mc3.onRelease = function(){
    	_root.menuCliccato = this;
    }
    mc4.onRollOver = function() {
    	clearInterval(a);
    	pos = this._x;
    	delete this.onEnterFrame;
    	riquadro.onEnterFrame = function() {
    		this._x = this._x+(pos-this._x)/7;
    		if (pos == Math.round(this._x)) {
    			this._x = pos;
    			delete this.onEnterFrame;
    		}
    	};
    };
    mc4.onRollOut = function() {
    	a = setInterval(tuttoComePrima, 2000);
    };
    mc4.onRelease = function(){
    	_root.menuCliccato = this;
    }
    CTRL+ENTER...

    ps: non prenderla come abitudine.......
    ciao
    -Nextart.it Graphic Solutions

  3. #3

  4. #4
    Utente di HTML.it
    Registrato dal
    Jul 2005
    Messaggi
    26
    Riporto in luce questo thread perchè tratta di una cosa che sto cercando di fare anche io.

    Ho seguito le istruzioni e cambiato alcuni parametri per aumentare la velocità di spostamento del mio oggetto lungo il menu ma nel complesso non comprendo lo script.


    So che chiedo molto a voi(in pazienza) e a me(in competenza) poichè son alle primissime armi, ma se qualcuno avesse tempo e voglia di commentare lo script per descriverne i passaggi gli/le sarei gratissima.



    Grazie!





    caitli

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.