# Sliding MC position relative to contents

**URL:** <https://forum.kirupa.com/t/sliding-mc-position-relative-to-contents/253427>\
**Category:** flash\
**Created:** [March 1, 2008, 1:15am UTC](https://forum.kirupa.com/t/sliding-mc-position-relative-to-contents/253427 "2008-03-01T01:15:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rynobot](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@rynobot](https://forum.kirupa.com/u/rynobot)\
**Post date:** [March 1, 2008, 1:15am UTC](https://forum.kirupa.com/t/sliding-mc-position-relative-to-contents/253427/1 "2008-03-01T01:15:03Z")

</div>

I have a movie clip that I have given the a “sliding” variable to move it across the X axis.  
So far I have been using a variable of

```auto
movieClip.newX = -250; 

```

, but what i need to do is have the movieclip slide to a position which is relative to an object inside of it.

As i need the slider to move to a position that centers the object which the slider contains on centered on the screen - i have tried:

```auto
movieClip.newX = movieClip.ContentsObject.Stage.width/2;

```

but with no response. I realise that code is incorrect, but need something that will work in that way. I presume i need some sort of listener to follow the \_x position of the specific movie clip.

Does that make sense? does anyone know?  
cheers,
