A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: random motion comes to a stop

  1. #1

    Wink

    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.

  2. #2
    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...
    }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center