Visualizzazione dei risultati da 1 a 10 su 10

Discussione: problemi al proto

  1. #1
    Utente bannato
    Registrato dal
    Feb 2004
    Messaggi
    2,803

    problemi al proto

    uso questo prototipo x il movimento dei mc in as...ma dopo qualche minuto dall'avvio del swf succedono cose strane..gli mc scompaiono..poi riappaiono dopo 30 sec...poi riscompaiono a loro piacimento.. VVoVe: ke succede?

    codice:
    MovieClip.prototype.funzione = function(x, y, a, sx, sy, steps) {
    	this.onEnterFrame = function() {
    		this._xstep = (Number(x)-this._x)/Number(steps);
    		this._ystep = (Number(y)-this._y)/Number(steps);
    		this._rot = (Number(a)-this._rotation)/Number(steps);
    		this._xsca = (Number(sx)-this._xscale)/Number(steps);
    		this._ysca = (Number(sy)-this._yscale)/Number(steps);
    		this._steps = steps;
    		if (this._steps) {
    			this._rotation += this._rot;
    			this._alpha += 10;
    			this._x += this._xstep;
    			this._y += this._ystep;
    			this._xscale += this._xsca;
    			this._yscale += this._ysca;
    			this._steps--;
    		} else {
    			delete this._xstep;
    			delete this._ystep;
    			delete this._xsca;
    			delete this._ysca;
    			delete this._steps;
    			this.onEnterFrame = function() {
    			};
    		}
    	};
    };

  2. #2
    Utente di HTML.it L'avatar di Uanne
    Registrato dal
    Nov 2001
    Messaggi
    483
    Puoi postare il codice di come applichi il metodo funzione() ai vari movieclip se da come sembra ne hai più di uno?
    A me mi dà la carica, agli italiani gli dà la carica

  3. #3
    Utente bannato
    Registrato dal
    Feb 2004
    Messaggi
    2,803
    esempio:
    Codice PHP:
    _root.pulsante1.onRollOver = function() {
        
    this.funzione(this._xthis._y014014010);
    };
    _root.pulsante1.onRollOut = function() {
        
    this.funzione(this._xthis._y010010010);
    };
    _root.pulsante1.onRelease = function() {
        
    _root.back.funzione(19030010010010);
    }; 

  4. #4
    Utente di HTML.it L'avatar di Uanne
    Registrato dal
    Nov 2001
    Messaggi
    483
    E' corretto.
    Mi sa che nella timeline ti sei perso per strada il pulsante e il movieclip 'back'...
    A me mi dà la carica, agli italiani gli dà la carica

  5. #5
    Utente di HTML.it L'avatar di Uanne
    Registrato dal
    Nov 2001
    Messaggi
    483
    No, scusa, rettifico...se hai pazienza domani ti posto il codice giusto, devo staccare, ciao.
    A me mi dà la carica, agli italiani gli dà la carica

  6. #6
    Utente di HTML.it L'avatar di Uanne
    Registrato dal
    Nov 2001
    Messaggi
    483
    Così è a posto:

    codice:
    MovieClip.prototype.funzione = function(x,y,sx,sy,steps){
    	this.onEnterFrame = function(){
    	this._x = this._x + (x -this._x)/steps;
    	this._y = this._y + (y -this._y)/steps;
    	this._xscale = this._xscale + (sx -this._xscale)/steps;
    	this._yscale = this._yscale + (sy -this._yscale)/steps;
    	diffx = Math.abs(x -this._x);
    	diffy = Math.abs(y -this._y);
    	diffsx = Math.abs(sx -this._xscale);
    	diffsy = Math.abs(sy -this._yscale);
    		if(diffx < 0.3 && diffy < 0.3 && diffsx < 0.3 && diffsy < 0.3){
    			this._x = x;
    			this._y = y;
    			this._xscale = sx;
    			this._yscale = sy;
    			delete this.onEnterFrame;
    		}
    	}
    }
    A me mi dà la carica, agli italiani gli dà la carica

  7. #7
    Utente bannato
    Registrato dal
    Feb 2004
    Messaggi
    2,803
    Originariamente inviato da Uanne
    Così è a posto:

    codice:
    MovieClip.prototype.funzione = function(x,y,sx,sy,steps){
    	this.onEnterFrame = function(){
    	this._x = this._x + (x -this._x)/steps;
    	this._y = this._y + (y -this._y)/steps;
    	this._xscale = this._xscale + (sx -this._xscale)/steps;
    	this._yscale = this._yscale + (sy -this._yscale)/steps;
    	diffx = Math.abs(x -this._x);
    	diffy = Math.abs(y -this._y);
    	diffsx = Math.abs(sx -this._xscale);
    	diffsy = Math.abs(sy -this._yscale);
    		if(diffx < 0.3 && diffy < 0.3 && diffsx < 0.3 && diffsy < 0.3){
    			this._x = x;
    			this._y = y;
    			this._xscale = sx;
    			this._yscale = sy;
    			delete this.onEnterFrame;
    		}
    	}
    }

    ok..ora sembra k vada tutto bene..
    potresti modificarlo in modo da avere un valore alpha?

    e poi nel nuovo proto non c'è + il valore "a" (rotazione)..se aggiungo questo

    Codice PHP:
     this._rot = (Number(a)-this._rotation)/Number(steps);
    if (
    this._steps) {
                
    this._rotation += this._rot
    è giusto?sn nelle tue mani..

  8. #8
    Utente bannato
    Registrato dal
    Feb 2004
    Messaggi
    2,803
    edit: se al posto di alpha (o come ulteriore valore)riesci a definire un controllo al filtro sfocatura nel proto diventi il mio mito

  9. #9
    Utente di HTML.it L'avatar di Uanne
    Registrato dal
    Nov 2001
    Messaggi
    483
    Per aggiungere la rotazione e l'alpha:

    codice:
    MovieClip.prototype.funzione = function(x,y,a,sx,sy,alfa,steps){
    	this.onEnterFrame = function(){
    	this._x = this._x + (x -this._x)/steps;
    	this._y = this._y + (y -this._y)/steps;
    	this._rotation = this._rotation + (a - this._rotation)/steps;
    	this._xscale = this._xscale + (sx -this._xscale)/steps;
    	this._yscale = this._yscale + (sy -this._yscale)/steps;
    	this._alpha = this._alpha + (alfa -this._alpha)/steps;
    	diffx = Math.abs(x -this._x);
    	diffy = Math.abs(y -this._y);
    	diffrot = Math.abs(a -this._rotation);
    	diffsx = Math.abs(sx -this._xscale);
    	diffsy = Math.abs(sy -this._yscale);
    	diffalfa = Math.abs(alfa -this._alpha);
    		if(diffx < 0.3 && diffy < 0.3 && diffsx < 0.3 && diffsy < 0.3 && diffrot < 0.3 && diffalfa < 0.3){
    			this._x = x;
    			this._y = y;
    			this._xscale = sx;
    			this._yscale = sy;
    			this._rotation = a;
    			this._alpha = alfa;
    			delete this.onEnterFrame;
    		}
    	}
    }
    basta così, ciao
    A me mi dà la carica, agli italiani gli dà la carica

  10. #10
    Utente bannato
    Registrato dal
    Feb 2004
    Messaggi
    2,803
    Originariamente inviato da Uanne
    Per aggiungere la rotazione e l'alpha:

    codice:
    MovieClip.prototype.funzione = function(x,y,a,sx,sy,alfa,steps){
    	this.onEnterFrame = function(){
    	this._x = this._x + (x -this._x)/steps;
    	this._y = this._y + (y -this._y)/steps;
    	this._rotation = this._rotation + (a - this._rotation)/steps;
    	this._xscale = this._xscale + (sx -this._xscale)/steps;
    	this._yscale = this._yscale + (sy -this._yscale)/steps;
    	this._alpha = this._alpha + (alfa -this._alpha)/steps;
    	diffx = Math.abs(x -this._x);
    	diffy = Math.abs(y -this._y);
    	diffrot = Math.abs(a -this._rotation);
    	diffsx = Math.abs(sx -this._xscale);
    	diffsy = Math.abs(sy -this._yscale);
    	diffalfa = Math.abs(alfa -this._alpha);
    		if(diffx < 0.3 && diffy < 0.3 && diffsx < 0.3 && diffsy < 0.3 && diffrot < 0.3 && diffalfa < 0.3){
    			this._x = x;
    			this._y = y;
    			this._xscale = sx;
    			this._yscale = sy;
    			this._rotation = a;
    			this._alpha = alfa;
    			delete this.onEnterFrame;
    		}
    	}
    }
    basta così, ciao

    e la sfocatura?
    grazie1.000.000 ciao..

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.