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

    [MX] Prototype.elasticScale

    Giorno a tutti,

    sto cercando di applicare questo Prototype.. ad un MC
    qual'è l'effetto?
    -al passaggio del mouse passa da x-y = 100 ad un valore =400 es.
    con andata e ritorno in moto elastico.

    ora..
    chiedevo se era possibile trasmettere l'effetto al MC al momento dell'apertura ? quindi escludendo il rollOver del mouse..
    questo è il codice:
    codice:
    MovieClip.prototype.elasticScale = function(targt, accel, friction) { 
    	this.speed += (targt - this._xscale) * accel;
    	this.speed *= friction;
    	this._xscale = this._yscale += this.speed;
    }
    al MC:
    codice:
    onClipEvent (enterFrame) { 
    	if (this.hitTest(_root._xmouse, _root._ymouse, true)) { 
    		this.elasticScale(400, .9, .6) 
    	} else { 
    		this.elasticScale(100, .6, .5) 
    	} 
    }
    ciao, grazie
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  2. #2
    sarà che ci prendo la mano..

    ho risolto così:
    codice:
    onClipEvent (enterFrame) {
    	_root.mc.scaleX = 100;
    	_root.mc.scaleY = 100;
    }
    sui frame del/a MC:
    codice:
    this.scaleX = _xscale=160;
    this.scaleY = _yscale=120;
    freno = 2;
    fri = .3;
    ------
    this._xscale-=(this._xscale-this.scaleX)/freno/fri;
    this._yscale-=(this._yscale-this.scaleY)/freno/fri;
    ------
    gotoAndPlay(2);


    sgulp!! sgnaf!! Sgnaus!!
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

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.