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

    Animazione porta scorrevole

    Ciao!
    devo simulare l'apertura di 2 ante scorrevoli.
    Creo 2 movie clip, e scrivo come loro codice
    Antasx
    codice:
    onClipEvent (enterFrame) {
    var	mousex=this._parent._parent._xmouse;
    var	mousey=this._parent._parent._ymouse;
    	if ((mousex>=0 && mousex<=122) && (mousey>=0 && mousey<=170)) {
    		if (this._x>-45) {
    			this._x = this._x-1;
    		}
    	} else {
    		if (this._x<0) {
    			this._x = this._x+1;
    		}
    	
    	}
    }
    Antadx
    codice:
    onClipEvent (enterFrame) {
    var	mousex=this._parent._parent._xmouse;
    var	mousey=this._parent._parent._ymouse;
    	if ((mousex>=0 && mousex<=122) && (mousey>=0 && mousey<=170)) {
    		if (this._x<45) {
    			this._x = this._x+1;
    		}
    	} else {
    		if (this._x>0) {
    			this._x = this._x-1;
    		}
    	
    	}
    }
    lasciando stare le mousex e mousey che mi servono solo per delle prove, guardando il filmato nell'anteprima flash, funziona, se invece utilizzo l'anteprima html, le 2 porte si aprono, ma non tornano alla posizione di partenza.

    Ariciao =)

  2. #2
    ciao ho provato il tuo codice ma non lo capisco

    sull'antasx io ho messo:
    codice:
    onClipEvent (enterFrame) {
    	var mousex = _xmouse;
    		if (mousex>0)  {
    //punto finale >>>>>  aperta
    	if (this._x>=148) {
    			this._x = this._x-1;
    		}
    	} else {
    //punto di partenza >>>>>  chiusa	
    		if (this._x<=168) {
    			this._x = this._x+1;
    		}
    	}
    }

    sull'antadx:

    codice:
    onClipEvent (enterFrame) {
    	var mousex = _xmouse;
    		if (mousex>0) {
    //punto finale >>>>>  aperta
    		if (this._x<=310) {
    			this._x = this._x+1;
    		}
    	} else {
    //punto di partenza >>>>>  chiusa
    		if (this._x>=290) {
    			this._x = this._x-1;
    		}
    	}
    }

    quindi mouse verso dx le ante si aprono, mouse verso sx le ante si chiudono..

    prova cosi'.

    -Nextart.it Graphic Solutions

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.