_rotation Direction to L and R

Hi
thanks for your time.

problem :

There is one wheel that Rotating using script.

when mouse moving to left , the wheel have to rotate TO LEFTward and

when mouse moving to right , the wheel have to rotate TO RIGHTward .

Here i am attaching FLA , please have a look and Help!

Nasih

Put this code within the onEnterFrame handler…
[AS]var dir = (_root._xmouse>this._x)-(_root._xmouse<this._x);
this._rotation += dir*25;[/AS]
… Like that? :stuck_out_tongue:

Yeah…works fine Thanks Kax :thumb:
-----------------------------------------------------------------------onClipEvent(load){
stop();
var Elastic = .03;

this.onEnterFrame = function(){
var dir = (_root._xmouse>this._x)-(_root._xmouse<this._x);
this._rotation += dir*25;
this._x += (_root._xmouse-this._x)*Elastic;
}
}

oh…when u posted … i fell asleep Sorry, if i am late.
Nasih

You’re welcome, Nasih. =)