ciao ho un problema devo far muovere un mc all'interno di uno stage in questo modo:
quando il mouse va a destra l'mc va a sx e quando il mouse va a sinistra l'mc va a dx e fin qui tutto ok...
Il problema è questo io vorrei che in base alle x del mouse l'mc si spostasse + velocemente .. penso di essermi spiegato male... cmq vi posto un esempio di un sito realizzato da un utente qui del forum http://www.thephb.it/thephb.html praticamente + andate a sx con il mouse + l'mc si sposta velocemente se invece muovete il mouse lentamente l'mc si sposta di conseguenza lentamente.. qualche consiglio x ottenere questo effetto? :master:Codice PHP:var mouseListener:Object = new Object ();
mouseListener.onMouseMove = function () {
if (_xmouse >_root.larghezzas/2+100 or _xmouse < _root.larghezzas/2 -100) {
if (_xmouse >= _root.larghezzas/2) {
ghiri_mc.onEnterFrame = function () {
if (this._x <= maxxghiris) {
delete this.onEnterFrame;
} else {
this._x = this._x - 2
}
}
} else {
ghiri_mc.onEnterFrame = function () {
if (this._x >= maxxghirid) {
delete this.onEnterFrame;
} else {
this._x = this._x + 2
}
}
}
} else {
// Non fa niente in caso il mouse rusulti fuori area
}
};
Mouse.addListener (mouseListener);

-
Rispondi quotando