Mouse mc boundaries

Hello, [SIZE=2]I do realize that I have already posted this at the AS section, but I felt that there was no response going to be made, and besides this is considered more a game than an AS problem… :nose:
[/SIZE]

Well here’s my problem:
I’m trying to “limit”or create a boundary for my mc that is being controlled by the influence of the mouse. here is the source:

PHP Code:
 		 		[LEFT] 			[COLOR=#000000] [COLOR=#ff8000]/**********************************************************
Hero Fish
Movement AI.

**********************************************************/
[/COLOR][COLOR=#0000bb]onClipEvent [/COLOR]COLOR=#007700 {
[/COLOR][COLOR=#0000bb]mousefollow [/COLOR][COLOR=#007700]= function () {
[/COLOR][COLOR=#0000bb]myRadians [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]Math[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]atan2[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]_ymouse[/COLOR][COLOR=#007700]-[/COLOR][COLOR=#0000bb]this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]_y[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]_xmouse[/COLOR][COLOR=#007700]-[/COLOR][COLOR=#0000bb]this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]_x[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]myDegrees [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]Math[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]round[/COLOR]COLOR=#007700;
[/COLOR][COLOR=#0000bb]_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]yChange [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]Math[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]round[/COLOR]COLOR=#007700;
[/COLOR][COLOR=#0000bb]_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]xChange [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]Math[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]round[/COLOR]COLOR=#007700;
if([/COLOR][COLOR=#0000bb]_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]moveAllow [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000bb]false[/COLOR][COLOR=#007700])
{
[/COLOR][COLOR=#0000bb]_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]xChange [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]0
_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]yChange [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]0
[/COLOR][COLOR=#007700]}
[/COLOR][COLOR=#0000bb]_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]yMove [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]Math[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]round[/COLOR]COLOR=#007700;
[/COLOR][COLOR=#0000bb]_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]xMove [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]Math[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]round[/COLOR]COLOR=#007700;

    [/COLOR][COLOR=#0000bb]this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]_y [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]yMove[/COLOR][COLOR=#007700];
    [/COLOR][COLOR=#0000bb]this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]_x [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]xMove[/COLOR][COLOR=#007700];
    [/COLOR][COLOR=#0000bb]this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]_rotation [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]myDegrees[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000bb]90[/COLOR][COLOR=#007700];

};
}

[/COLOR][COLOR=#0000bb]onClipEvent [/COLOR]COLOR=#007700 {
[/COLOR][COLOR=#0000bb]mousefollow[/COLOR]COLOR=#007700;
}
[/COLOR] [/COLOR] [/LEFT]

(Slightly modified from Actionscript.org tutorials.)

When I test my .swf it works ok because when the mouse is out of the .swf box the mc can no longer pass the boundary, but when I make my application full screen the mc follows my mouse past the given boundary.
see below pictures.

So I wanted to limit the mc, but at the same time allow it to follow my mouse, while the mouse is outside the box.


Good MC, stay inside that little box sucker!!!


Bad mc… stay in that boundary!!!

So I’m open to any suggestion…

Here’s some of my hypothesis… So I don’t act like a actionscript freeloader…

I could use an if statement?
I could create a square, boundary mc labeled boundary, and if hit test is true, move it back? , but having the chance of being stuck…

I’m clueless…

Something along these lines?

C:-)

ah that is wonderful :smiley: thanks