A Question to do with Movement Using ActionScript

I went through the tutitoral my question is what action script do you use to stop the box from moving for instance you can rollover to make the box move but then how do you make it so when you roll out the box will stop?

Thanks
Marcel

whats ur actionscript to make it move?
if it’s a movie that plays on rollOver:

on(rollOut){
box.stop();
}

Hi my friend gave me some action script to move an object up and down but they are all movies I need to know what action script to use if I am working with buttons to make the object move up and down. Thanks

Something like this:

myListener = new Object();
keyDown = function () {
  trace ("You pressed a key.");
  // put anything you want to do in there
}
Key.addListener(myListener);

box.onRollOver = function () {
  myListener.onKeyDown = keyDown ;
} ;
box.onRollOut = function () {
  delete myListener.onKeyDown ;
} ;[/As]
If you need something more specific, please post the code you're using.

Shot for the feedback but I wasn’t talking about actual buttons on the keyboard I was talking about making buttons in flash and using them to make the object move up and down. :rabbit:

Uhh if your running flash MX look under your… program files>macromedia>flash mx>samples>fla(i think thats the folder might be just in samples). They have an example of every movement type, just copy and paste and change the mvclips names. hope that helped, if your new to flash look over some of the other examples in there to help you grasp the concept.

It’s the asme kind of code :slight_smile:

myListener = new Object();
move = function () {
  this._x += 5 ;
  // put anything you want to do in there
}

clip.onRollOver = function () {
  box.onEnterFrame = move ;
} ;
clip.onRollOut = function () {
  delete box.onEnterFrame ;
} ;[/As]