PDA

Click to See Complete Forum and Search --> : random motion comes to a stop



2celldesign
03-26-2002, 09:27 PM
hi there.
anyone know i can make three objects move randomly at the beginning but then have them move to a fixed stop (x,y) upon rollover or release?
any help is appreciated.

DonDanny
03-27-2002, 02:13 PM
As far is I understood it, you would like to stop the object from moving on mouseover.
So just check if the mouse is over that object with hitTest() or if it is a button with a button event, and if that's true go to the x and y position.

The code could somehow look like this:

onClipEvent(enterFrame){
if(this.hitTest(_parent._xmouse,_parent._ymouse)){
go to the x and y coordinates...
}else{
do random movement...
}
}