Visualizzazione dei risultati da 1 a 5 su 5

Discussione: zoom

  1. #1
    Utente di HTML.it L'avatar di memo73
    Registrato dal
    Sep 2002
    Messaggi
    34

    zoom

    Ho creato un mc e gli ho assegnato il seguente codice per testare un semplice zoom in AS (stò cercando d'imparare). Il problema è che quando s'ingrandisce riesco a fermarla ad una determinate grandezza mentre quando si rimpicciolisce no...why?

    onClipEvent (load) {
    zoom = 3;
    }
    on (rollOver) {
    useHandCursor = false;
    i = this._width;
    a = this._height;
    this.onEnterFrame = function() {
    if ((this._width<=290) && (this._height<=250)) {
    i += zoom;
    a += zoom;
    this._width = i;
    this._height = a;
    }
    }
    }
    on (rollOut) {
    i = this._width;
    a = this._height;
    this.onEnterFrame = function() {
    if ((this._width != 230) && (this._height != 200)) {
    i -= zoom;
    a -= zoom;
    this._width = i;
    this._height = a;
    }
    }
    }

    Help me please

    Bye

  2. #2
    Perchè sul rollout come condizione metti "diverso di", invece di "maggiore di"?

  3. #3
    Utente di HTML.it L'avatar di memo73
    Registrato dal
    Sep 2002
    Messaggi
    34
    Che pir*# che sono...grazie e scusa, ma sono agli inizi con AS.

    Thankssssss!!!!

    Bye

  4. #4
    visto che stai agli inizi, ti consiglio di usare bene i codice.
    Come hai fatto tu non è sbagliato, però fai lavorare a vuoto la cpu (perchè chiami l'evento onEnterFrame ma non lo cancelli).

    Prova ad inserire il seguente codice all'interno del movieClip sul frame:

    codice:
    // PARAMETRI INIZIALI //
    this.zum = 3;
    this.useHandCursor = false;
    /// ROLL OVER ///
    this.onRollOver = function() {
    	(this.onEnterFrame != undefined) ? delete this.onEnterFrame : '';
    	this.onEnterFrame = function() {
    		if ((this._width<=290) && (this._height<=250)) {
    			this._width += this.zum;
    			this._height += this.zum;
    		} else {
    			delete this.onEnterFrame;
    		}
    	};
    };
    /// ROLL OUT ///
    this.onRollOut = function() {
    	(this.onEnterFrame != undefined) ? delete this.onEnterFrame : '';
    	this.onEnterFrame = function() {
    		if ((this._width>=230) && (this._height>=200)) {
    			this._width -= this.zum;
    			this._height -= this.zum;
    		} else {
    			delete this.onEnterFrame;
    		}
    	};
    };
    Ovviamente l'errore era quello che ti ha indicato Stan

    regalami un oggi da favola...e il domani bhe!?non mi importa se tu 6 con me! ©Ily

  5. #5
    Utente di HTML.it L'avatar di memo73
    Registrato dal
    Sep 2002
    Messaggi
    34
    Ci proverò subito!!!
    Grazie per lo sbatti e per il consiglio!!! ))))))))))

    Bye

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.