# What's the AS equivilent of C++'s "switch" command?

**URL:** <https://forum.kirupa.com/t/whats-the-as-equivilent-of-c-s-switch-command/254323>\
**Category:** Uncategorized\
**Created:** [March 10, 2008, 11:05pm UTC](https://forum.kirupa.com/t/whats-the-as-equivilent-of-c-s-switch-command/254323 "2008-03-10T23:05:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldmanwinter](https://avatars.discourse-cdn.com/v4/letter/o/b38774/32.png) [@oldmanwinter](https://forum.kirupa.com/u/oldmanwinter)\
**Post date:** [March 10, 2008, 11:05pm UTC](https://forum.kirupa.com/t/whats-the-as-equivilent-of-c-s-switch-command/254323/1 "2008-03-10T23:05:39Z")

</div>

in case you don’t know, a switch command in C++ goes something like this:

```auto

switch(numbervariable)
case(1)
{
   //code you want executed when numbervariable is equal to one
}
case(2)
{
   //code you want executed when numbervariable is equal to two
}
case(3)
{
   //code you want executed when numbervariable is equal to three
}

```

anyone know how to do something like that in ActionScript? TIA 🙂
