# Random movement to screen extents

**URL:** https://forum.kirupa.com/t/random-movement-to-screen-extents/248406
**Category:** flash
**Created:** [January 7, 2008, 11:48pm UTC](https://forum.kirupa.com/t/random-movement-to-screen-extents/248406 "2008-01-07T23:48:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JackieMoon](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@JackieMoon](https://forum.kirupa.com/u/JackieMoon)
#### Post date: [January 7, 2008, 11:48pm UTC](https://forum.kirupa.com/t/random-movement-to-screen-extents/248406/1 "2008-01-07T23:48:43Z")

</div>

What is the best way to make something move until it hits the edges of the screen and then change direction until it hits another edge? I have a clip right now that moves randomly, but it will just arbitrarily move randomly instead of bouncing off the screen edges. I’ve seen tons of examples of what I have now, but I haven’t seen many with what I want. Thanks for any help you can give me.
