# Moving a MC

**URL:** <https://forum.kirupa.com/t/moving-a-mc/27102>\
**Category:** Uncategorized\
**Created:** [July 30, 2003, 5:06am UTC](https://forum.kirupa.com/t/moving-a-mc/27102 "2003-07-30T05:06:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![buddylee](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@buddylee](https://forum.kirupa.com/u/buddylee)\
**Post date:** [July 30, 2003, 5:06am UTC](https://forum.kirupa.com/t/moving-a-mc/27102/1 "2003-07-30T05:06:59Z")

</div>

Ok, should be simple, but it has been a long time since I have coded. I have a MC with the instance name of “price”. When I click another MC that says “Competetors”, I want “price” to move over left 50, and then up 60. I have tried everything I could remember but it has not been working. Can someone please explain to me how to make this one fluid motion. Anything…

Thanks guys

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 5:36am UTC](https://forum.kirupa.com/t/moving-a-mc/27102/2 "2003-07-30T05:36:44Z")

</div>

for a transitioned movement

actionscript on mc price

```auto

onClipEvent(load){
  this.trip=false;
  xdiff= -50;
  ydiff= -60;
}
onClipEvent(enterFrame){
  if(this.trip){
    if(this._y!=ydiff){
      _y--);
    }
    if(this._x!=xdiff){
      _x--;
    }
  }
}

```

then on the competitors mc you have

```auto

on(mouseDown){
  if(_xmouse>this._x&&_xmouse<this._x+this._width&&_ymouse>this._y&&_ymouse<this._y+this._height){
    price.trip=true;
  }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 3:02pm UTC](https://forum.kirupa.com/t/moving-a-mc/27102/3 "2003-07-30T15:02:00Z")

</div>

I think I see what you are trying to do here, but it is giving me some errors…

```php
Scene=Scene 1, Layer=Text, Frame=1: Line 9: ';' expected
                             _y--);

Scene=Scene 1, Layer=Text, Frame=1: Line 15: Unexpected '}' encountered
     }

Scene=Scene 1, Layer=Text, Frame=1: Line 1: Invalid mouse event specified.
     on(mouseDown){

Scene=Scene 1, Layer=Text, Frame=1: Line 2: Statement must appear within on/onClipEvent handler
             if(_xmouse>this._x&&_xmouse<this._x+this._width&&_ymouse>this._y&&_ymouse<this._y+this._height){

Scene=Scene 1, Layer=Text, Frame=1: Line 5: Unexpected '}' encountered
     }

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 3:13pm UTC](https://forum.kirupa.com/t/moving-a-mc/27102/4 "2003-07-30T15:13:36Z")

</div>

try this on the mc. this is actually easing motion, but its easier than normal motion

onClipEvent(load){  
x=\_x  
y=\_y  
finalxpos=-60  
finalypos=-50  
finalxpos2=x+finalxpos  
finalypos2=y+finalypos  
}  
onClipEvent(enterFrame){  
\_x+=(finalxpos2-\_x)/5  
\_y+=(finalypos2-\_y)/5  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 31, 2003, 1:41pm UTC](https://forum.kirupa.com/t/moving-a-mc/27102/5 "2003-07-31T13:41:33Z")

</div>

I cant seem to get any of this to work. Is there any way we could have a Do While loop. Maybe like…

```php
Do _root.myprice._x -=5{
         While()_root._x >=50

```

Something similar to that?
