# Getting the distance between two movieclips' x value

**URL:** <https://forum.kirupa.com/t/getting-the-distance-between-two-movieclips-x-value/312594>\
**Category:** flash\
**Created:** [August 8, 2010, 9:23am UTC](https://forum.kirupa.com/t/getting-the-distance-between-two-movieclips-x-value/312594 "2010-08-08T09:23:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ransom1337](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@Ransom1337](https://forum.kirupa.com/u/Ransom1337)\
**Post date:** [August 8, 2010, 9:23am UTC](https://forum.kirupa.com/t/getting-the-distance-between-two-movieclips-x-value/312594/1 "2010-08-08T09:23:51Z")

</div>

Hello,

At first it seemed simple to find out the distance between two movieclips’ x values, I could have just done:

```auto
mc1.x - mc2.x

```

However, What I’m trying to achieve is a movieclip of a person climbing an un-even surfaced wall, and to do this I first want to make sure the x value of the person is always equal to the edge of the wall.

How would I calculate the exact position of wall’s edge where the person is touching it? I’ve attached an image to show what I mean.

Thanks.
