# Simple problem, Bouncing cursor, fla attached, thanks

**URL:** https://forum.kirupa.com/t/simple-problem-bouncing-cursor-fla-attached-thanks/216502
**Category:** Uncategorized
**Created:** [February 17, 2007, 3:19am UTC](https://forum.kirupa.com/t/simple-problem-bouncing-cursor-fla-attached-thanks/216502 "2007-02-17T03:19:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![alavery](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@alavery](https://forum.kirupa.com/u/alavery)
#### Post date: [February 17, 2007, 3:19am UTC](https://forum.kirupa.com/t/simple-problem-bouncing-cursor-fla-attached-thanks/216502/1 "2007-02-17T03:19:47Z")

</div>

[http://www.kirupa.com/developer/mx/ASmovement.htm](http://www.kirupa.com/forum/../developer/mx/ASmovement.htm)

This tutorial shows me how to move 1 pixcel right/left/up/down every 25 milli-seconds which is great but I need to do something completely different.

I have drawn a grid on one layer and I have a movie clip called “test\_mc” on another layer. “test\_mc” is a just a square that hovers over the grid and highlights a paricular cell in the grid. I have managed to get the test\_mc square moving around the grid with this code:

```auto

down.onRelease = function()
{
    var bounce = 0;
    // local variables
    if(bounce == 0)
    {
        if(test_mc._y < 412.5)
        {
            test_mc._y += 100;
            trace("bounce" + bounce);
        }
        else
        {
            bounce = 1;
            test_mc._y -= 100;
            trace("bounce" + bounce);
        }
    }
}

```

This code works fine.

Although I want it to bounce off the bottom and continue to go up until it gets back to square one. Its a simple problem for anyone whos a decent programmer.
