Hello there,
I have an image that follows the cursor on its x-axis only, but when the cursor isnt on the stage i want the image to return to a pre-defined position. Its some decoration for a flash nav on a website.
Heres the code..
ball_mc.onEnterFrame = function() {
var xMouse = _root._xmouse;
if (Math.abs(xMouse-this._x)<1) {
this._x = xMouse;
} else {
this._x -= (this._x-xMouse)/6;
}
};
All help appreciated.
Merry Christmas!
movie clip returns to original position
Started by getoffmyland, Dec 13 2005 05:40 PM
5 replies to this topic
#1
Posted 13 December 2005 - 05:40 PM
#2
Posted 17 December 2005 - 09:09 AM
post the fla file or mail it to me
#3
Posted 18 December 2005 - 02:08 PM
Hi,
.fla is attached. Thankyou for your help.
Matt
.fla is attached. Thankyou for your help.
Matt
#4
Posted 18 December 2005 - 02:11 PM
i attached the file but i cannot see where it can be accessed??
what is your email address, i will email it to you.
matt
what is your email address, i will email it to you.
matt
#5
Posted 22 December 2005 - 03:37 PM
hey matt.. I was just playing around with almost the same thing and I came up with this solution:
now you just need to re-write your actionscript so it reacts on the variables
var left:Number = 0; //left stage boundary var top:Number = 0; //top stage bounday var right:Number = Stage.width;//right stage boundary var bottom:Number = Stage.height;//bottom stage boundary
now you just need to re-write your actionscript so it reacts on the variables
Edited by funkysoul, 22 December 2005 - 03:38 PM.
#6
Posted 12 January 2006 - 01:17 PM
thanks funkysoul,
my knowledge of actionscript is quite limited, could you elaborate on what your code does, where it goes etc.
I cut and paste it into my script and tweaked the values but nothing changed.
thanks
matt
my knowledge of actionscript is quite limited, could you elaborate on what your code does, where it goes etc.
I cut and paste it into my script and tweaked the values but nothing changed.
thanks
matt
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
