# Not able to move?

**URL:** https://forum.kirupa.com/t/not-able-to-move/322574
**Category:** flash
**Created:** [May 25, 2011, 7:54pm UTC](https://forum.kirupa.com/t/not-able-to-move/322574 "2011-05-25T19:54:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![TheAwesomeDude](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@TheAwesomeDude](https://forum.kirupa.com/u/TheAwesomeDude)
#### Post date: [May 25, 2011, 7:54pm UTC](https://forum.kirupa.com/t/not-able-to-move/322574/1 "2011-05-25T19:54:09Z")

</div>

Hi! Im trying diffrent things to learn Flash. I wrote this very simple code that moves a 50 x 50 big cube.

```php
Block.addEventListener(MouseEvent.CLICK, fl_ClickToPosition);

function fl_ClickToPosition(event:MouseEvent):void
{
    Block.x += 50;    
}

```

Then I did another Cube also 50 x50 pixels. As you can see on the code… If I press Block, block moves 50 to the right. Now. Here comes my problem. I want the cube to stop for the other cube called “Wall”. But i dont know how to do that.

I want Block to be able so move as many times as poassible. But if “Wall” stands in the way. Block shouldnt be able to move.
