# Bounds in flash?

**URL:** <https://forum.kirupa.com/t/bounds-in-flash/190238>\
**Category:** Uncategorized\
**Created:** [June 9, 2006, 5:51pm UTC](https://forum.kirupa.com/t/bounds-in-flash/190238 "2006-06-09T17:51:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aldomatic](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@aldomatic](https://forum.kirupa.com/u/aldomatic)\
**Post date:** [June 9, 2006, 5:51pm UTC](https://forum.kirupa.com/t/bounds-in-flash/190238/1 "2006-06-09T17:51:07Z")

</div>

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
