[FMX04] Movement

Now, I was wondering: Is it possible to have this occur:

-User selects a button
-a box slides over
-when the user selects said button again, box slides back to original position

I was able to do this with motion tweening, but I keep reading about how you can do this in AS to keep it efficient. Any help would be appreciated.

Sure, all you’ve gotta do is swap onRollOver handler. The first thing that comes to my (clouded, since it’s late here) mind is using a flag to determine whether the mouse has already been over or not. Like this:


flag = 0;
theButton.onRollOver = function(){
if(flag){
//box slides back here
} else {
//box slides to the button here
}
flag = !flag;
}