rkashef
01-27-2007, 12:02 AM
I have this cartoon character in my movie, and I want his eyes to follow the cursor.. so i tried to use this code
rotation_speed = 0;
elasticity = 0.1;
_root.onEnterFrame = function()
{
with (Iris) {
_rotation += rotation_speed;
_x += (_root._xmouse-_x)*elasticity;
_y += (_root._ymouse-_y)*elasticity;
}
and I was able to make the black dot (Iris) move with the cursor, but then it goes out of sight if I move the mouse too far out of the eye's range... I've used masking for this, but I need a code to limit the movement range of the Iris within the eye... can anyone help me, I've been trying so hard :confused:
rotation_speed = 0;
elasticity = 0.1;
_root.onEnterFrame = function()
{
with (Iris) {
_rotation += rotation_speed;
_x += (_root._xmouse-_x)*elasticity;
_y += (_root._ymouse-_y)*elasticity;
}
and I was able to make the black dot (Iris) move with the cursor, but then it goes out of sight if I move the mouse too far out of the eye's range... I've used masking for this, but I need a code to limit the movement range of the Iris within the eye... can anyone help me, I've been trying so hard :confused: