Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 11
  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786

    Aiuto per effetto in loop

    Salve,

    mi servirebbe per favore un'aiuto:

    Sul forum ho trovato questo codice as da applicare a un clip "mc":

    codice:
    MovieClip.prototype.solar = function (defcolor) {
    	this.c = new Color(this);
    	this.o = new Object({rb:255,gb:255,bb:255});
    	this.up = true;
    	this.onEnterFrame = function () {
    		if (this._alpha<100) {
    			this._alpha += 10;
    		}
    		if (!this.up) {
    			this.o.rb -= 10;
    			this.o.gb -= 10;
    			this.o.bb -= 10;
    		} else {
    			if (this.o.rb<=255) {
    				this.o.rb *= 1.5;
    				this.o.gb *= 1.3;
    				this.o.bb *= 3;
    			} else {
    				this.o = {rb:255, gb:255, bb:255};
    				this.up = false;
    			}
    		}
    		this.c.setTransform(this.o);
    		if (this.o.rb<=0) {
    			this.o = defcolor;
    			this.c.setTransform(this.o);
    			delete this.onEnterFrame;
    		}
    	}
    }
    
    mc.solar();
    l'effetto è simile alle foto in entrata come QUI


    Quello che vorrei è:

    che la foto resti visibile per 1/2 secondi poi scompare (dissolvenza) e ne appare un'altra sempre con lo stesso effetto.

    insomma, che ci siano tre foto che girano,
    e dopo incomincia di nuovo con la prima.

    Come posso fare ?

    Grazie !!!!
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  2. #2
    se ho capito lo script al posto del this.up=false devi inserire un setInterval(conta, 2000)

    e nella funzione conta al termine dei 2 secondi impostare il nome del clip.up=false

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    sono un po (parecchio ) digiuno di AS.

    Come devo usare:

    codice:
    setInterval(conta, 2000);
    clip.up = false;
    grazie 10000 !
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  4. #4

  5. #5
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    Grazie !!!!

    un'altra info:

    Faccio altri clip che chiamo "mc2" e "mc3" che posiziono sullo stage a distanza ed applico mc2.solar(); e poi mc3.solar(); ? per le altre foto ?

    Grazie !
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  6. #6
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    Non funziona

    mi aiuti per favore ?

    Grazie !

    codice:
    MovieClip.prototype.solar = function (defcolor) {
    	this.c = new Color(this);
    	this.o = new Object({rb:255,gb:255,bb:255});
    	ID_conta = setInterval(conta, 2000);
    	function conta() {
    		clip.up = false
    	}
    	this.onEnterFrame = function () {
    		if (this._alpha<100) {
    			this._alpha += 10;
    		}
    		if (!this.up) {
    			this.o.rb -= 10;
    			this.o.gb -= 10;
    			this.o.bb -= 10;
    		} else {
    			if (this.o.rb<=255) {
    				this.o.rb *= 1.5;
    				this.o.gb *= 1.3;
    				this.o.bb *= 3;
    			} else {
    				this.o = {rb:255, gb:255, bb:255};
    				this.up = false;
    			}
    		}
    		this.c.setTransform(this.o);
    		if (this.o.rb<=0) {
    			this.o = defcolor;
    			this.c.setTransform(this.o);
    			delete this.onEnterFrame;
    		}
    	}
    }
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  7. #7
    non posso provarlo ma prova così

    codice:
    function conta() {
        mc1.up = false
        // ricordati di cancellare il l'Interval
    }
    
    MovieClip.prototype.solar = function (defcolor) {
    	this.c = new Color(this);
    	this.o = new Object({rb:255,gb:255,bb:255});
    	
                 this.onEnterFrame = function () {
    		if (this._alpha<100) {
    			this._alpha += 10;
    		}
    		if (!this.up) {
    			this.o.rb -= 10;
    			this.o.gb -= 10;
    			this.o.bb -= 10;
    		} else {
    			if (this.o.rb<=255) {
    				this.o.rb *= 1.5;
    				this.o.gb *= 1.3;
    				this.o.bb *= 3;
    			} else {
    				this.o = {rb:255, gb:255, bb:255};
    				ID_conta = setInterval(conta, 2000);
    			}
    		}
    		this.c.setTransform(this.o);
    		if (this.o.rb<=0) {
    			this.o = defcolor;
    			this.c.setTransform(this.o);
    			delete this.onEnterFrame;
    		}
    	}
    }
    
    mc1.solar()

  8. #8
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    non funziona !
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  9. #9
    Mantieni la calma


    ho avuto bisogno di provarlo adesso funziona


    codice:
    MovieClip.prototype.solar = function (defcolor) {
    	this.c = new Color(this);
    	this.o = new Object({rb:255,gb:255,bb:255});
    	this.up = true;
    
        this.onEnterFrame = function () {
    		// questo lo esegue
    		if (this._alpha<100) {
    			this._alpha += 10;
    		}
    
    		if (!this.up) {
    			this.o.rb -= 10;
    			this.o.gb -= 10;
    			this.o.bb -= 10;
    
    		} else {
    
    			if (this.o.rb<=255) {
    				this.o.rb *= 1.5;
    				this.o.gb *= 1.3;
    				this.o.bb *= 3;
    
    			} else {
    				
    				this.o = {rb:255, gb:255, bb:255};
    				this.up = false
    				
    			}
    		}
    		this.c.setTransform(this.o);
    		if (this.o.rb<=0) {
    			trace(this.o.rb)
    			this.o = defcolor;
    			this.c.setTransform(this.o);
    			_level0.ID_conta = setInterval(_level0.conta, 2000);
    			delete this.onEnterFrame;
    		}
    	}
    }
    
    // assegno all'mc1 il prototipo
    mc1.solar()
    
    
    n = 0;
    function conta() {
       n++;
    	trace("sono passati:"+(2*n)+" secondi");
    	if (n >=1) {
                    /* ---------------------------------------------------------------------
                        per riprovarlo riassegno mc1 al prototipo ma tu dovrai passare gli altri clip
                    ------------------------------------------------------------------------ */
    		mc1.solar()
    		n=0
    		clearInterval(ID_conta);
    	}
    }

  10. #10
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    GRAZIE !
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

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.