# Moving a timeline movieclip using a class

**URL:** <https://forum.kirupa.com/t/moving-a-timeline-movieclip-using-a-class/268274>\
**Category:** Uncategorized\
**Created:** [August 12, 2008, 4:27am UTC](https://forum.kirupa.com/t/moving-a-timeline-movieclip-using-a-class/268274 "2008-08-12T04:27:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwiniquit](https://avatars.discourse-cdn.com/v4/letter/i/7993a0/32.png) [@iwiniquit](https://forum.kirupa.com/u/iwiniquit)\
**Post date:** [August 12, 2008, 4:27am UTC](https://forum.kirupa.com/t/moving-a-timeline-movieclip-using-a-class/268274/1 "2008-08-12T04:27:49Z")

</div>

How do you get a class to see/talk to several different movieclips on the main timeline?

For example, let’s say I want to move the x and y position of a movieclip that’s already on my timeline.

And my .as file code looks like

```auto

package com.main {
    import flash.display.*;
    
    public class MoveItem extends MovieClip {
        
        public function MoveItem() {
            mc.x = 25;
            mc.y = 25;
            md.x = 50;
            md.y = 50;            
        }
    }
}

```

And then I import it on the main timeline using:

```auto
import com.main.MoveItem;
var test:MoveItem = new MoveItem();

```

I know I could just send the name of the instance through the main function but I’d like to stray away from that. Any ideas or suggestions would be greatly appreciated!
