Visualizzazione dei risultati da 1 a 5 su 5

Discussione: terremoto

  1. #1
    Utente di HTML.it L'avatar di Gelion
    Registrato dal
    Jul 2002
    Messaggi
    1,233

    terremoto

    se associo questo codice
    onClipEvent(load){
    this.x = this._x;
    this.y = this._y;
    }
    onClipEvent(enterFrame){
    if(this.trema){
    this._x += Math.round(Math.random() * 2) - 1;
    this._y += Math.round(Math.random() * 2) - 1;
    } else {
    this._x = this.x;
    this._y = this.y;
    }
    this.trema = !this.trema
    }
    ad un mc quando parte il filmato trema

    ma se volessi che trema solo dopo aver cliccato un bottono o solo quando ci passo sopra?
    Se non è bello ciò che è bello figuriamoci ciò che è brutto...

  2. #2
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    codice:
    onClipEvent(load){
    	this.x = this._x; 
    	this.y = this._y; 
    } 
    onClipEvent(enterFrame){
    	if(this.sopra){
    		if(this.trema){ 
    			this._x += Math.round(Math.random() * 2) - 1; 
    			this._y += Math.round(Math.random() * 2) - 1; 
    		} else { 
    			this._x = this.x; 
    			this._y = this.y; 
    		} 
    		this.trema = !this.trema 
    	}
    }
    onClipEvent(mouseMove){
    	if(this.hitTest(_root._xmouse, _root._ymouse, true)){
    		this.sopra = true;
    	} else {
    		this.sopra = false;
    	}
    }

  3. #3
    Utente di HTML.it L'avatar di Gelion
    Registrato dal
    Jul 2002
    Messaggi
    1,233
    e per fare in modo che succeda se clicco su un pulsante?
    Se non è bello ciò che è bello figuriamoci ciò che è brutto...

  4. #4
    Per sfruttare il codice di Negatyve
    ed ipotizzando che l'istanza del tuo movieclip sia pippo e che sia sulla root...
    al pulsante associ:
    codice:
    on (release) {
        _root.pippo.sopra = true;
    }

  5. #5
    Utente di HTML.it
    Registrato dal
    Nov 2002
    Messaggi
    25
    potrei personalizzarlo facendo in modo che a un determinato foto gramma si metta in movimento e ci rimanga?

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.