Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with Joke

Status
Not open for further replies.

SouTh215

Technical User
Mar 16, 2006
1
US
Trying to do something for Myspace.com Someone posted something dumb on my myspace and I was going to do it back to him but with a more personal touch. I was wondering if someone could tell me how to get a Button to run from the mouse. I know how to make it move when i am over it but then it just moves back. I need it to stay. and then move to another place when the move clost to it again.
 
Create a button and give it an instance name (example here is btnTest).

Add this code to the main timeline:

Code:
_root.btnTest.onRollOver = function(){
	_root.btnTest._x = random(500);
	_root.btnTest._y = random(400);
};

Just adjust the _x and _y values for the size of the stage.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top