Movement trouble!

Hey people!

I’ve got a little question for ya. Please take a look at the attached .fla so you know what I’m talking about.

What I would like to do is to make the MC (the tiny box) move up and down, only when the mouse is inside the “borders”. I have no idea on how to do this, so if anyone got some tips, it would be very NICE!

cheers :beam:

this is how I would do it… Um… I’m giving you the hint so you can experiment, but it is a pretty good hint.

make the big square into an MC… use getBounds to get the xMin xMax, yMin and yMax (the bounds)

once you have that information you say something like:

if my mouse is greater than xMin and Less than xMax do the little box movement.

Of course, while you’re at it, you could simply use HitTest… in other words, if my mouse is touching the bigSquare movie clip, make the small square move.

If you get stuck, please let me know.

wow! i think i know how to get the same thing i had to werk too! thanks montoya!

I’m afraid I need a little more help, I’m not that good at actionscripting… yet :slight_smile:

I get the idea, but don’t know how to use the getBounds code and etc.

And mdipi, please let me know if you get it to work! :wink:

well i just got to the AS part in my book so i kinda think i knew how to use it. this is my code so far:
[AS]onClipEvent (load) {
trace.box.getBounds(minX, maxX, minY, maxY);
}
[/AS]

but it wont open the output window.