i have a “circle_mc” movie clip and its registratoin is in the center but it moves and works fine but i dont want it to go off the stage half way i want it to stop before it goes off
anyone?
ActionScript Code:
[FONT=Courier New][LEFT]circle_mc.[COLOR=#0000FF]onRollOver[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]this[/COLOR].[COLOR=#000080]dx[/COLOR] = [COLOR=#0000FF]Math[/COLOR].[COLOR=#0000FF]round[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]Math[/COLOR].[COLOR=#0000FF]random[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]*[COLOR=#0000FF]Stage[/COLOR].[COLOR=#0000FF]width[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]this[/COLOR].[COLOR=#000080]dy[/COLOR] = [COLOR=#0000FF]Math[/COLOR].[COLOR=#0000FF]round[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]Math[/COLOR].[COLOR=#0000FF]random[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]*[COLOR=#0000FF]Stage[/COLOR].[COLOR=#0000FF]height[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]onEnterFrame[/COLOR] = moveIt;
[COLOR=#000000]}[/COLOR];
[COLOR=#000000]function[/COLOR] moveItCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]_x[/COLOR] += COLOR=#000000[/COLOR]/[COLOR=#000080]10[/COLOR];
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]_y[/COLOR] += COLOR=#000000[/COLOR]/[COLOR=#000080]10[/COLOR];
[COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000FF]Math[/COLOR].[COLOR=#0000FF]round[/COLOR]COLOR=#000000[/COLOR] == [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]dx[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]_x[/COLOR] = [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]dx[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
-aldo