# Move object and switch(case) the x value of object

**URL:** <https://forum.kirupa.com/t/move-object-and-switch-case-the-x-value-of-object/282540>\
**Category:** Uncategorized\
**Created:** [February 23, 2009, 3:11pm UTC](https://forum.kirupa.com/t/move-object-and-switch-case-the-x-value-of-object/282540 "2009-02-23T15:11:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![descalabro](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@descalabro](https://forum.kirupa.com/u/descalabro)\
**Post date:** [February 23, 2009, 3:11pm UTC](https://forum.kirupa.com/t/move-object-and-switch-case-the-x-value-of-object/282540/1 "2009-02-23T15:11:35Z")

</div>

What I’m trying to do here is capture and use the x coordinate of my dummy\_MC to gotoAndPlay the correct movement animation.

```auto

case Key.RIGHT :
 switch (_global.posture) {
  case 1 :
   dummyorient = "right";
   _root.dummy_MC._x += speed;
   switch (_root.dummy_MC._x) {
    case "<450" :
     trace("< 450");
     _root.dummy_MC.gotoAndPlay("frame case 450");
     break;
    case "> 449 && < 550" :
     trace("> 449 && < 550");
     _root.dummy_MC.gotoAndPlay("frame case 449 550");
     break;
    case "> 549" :
     trace("> 549");
     _root.dummy_MC.gotoAndPlay("frame case 549");
     break;
   }
  break;

```

The rest of the code is working, the dummy\_MC moves correctly.

This, however, isn’t working, neither if I use:

```auto

case (<450) :

```

What’s the way to do this using a switch action?  
Logic tells me swtich actions are able to answer any possible condition, just like using IF, so the problem must be the syntax.

Thank you for reading.
