# Flash Variable to play MovieClip

**URL:** <https://forum.kirupa.com/t/flash-variable-to-play-movieclip/207166>\
**Category:** flash\
**Created:** [November 15, 2006, 6:22am UTC](https://forum.kirupa.com/t/flash-variable-to-play-movieclip/207166 "2006-11-15T06:22:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikflash](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mikflash](https://forum.kirupa.com/u/mikflash)\
**Post date:** [November 15, 2006, 6:22am UTC](https://forum.kirupa.com/t/flash-variable-to-play-movieclip/207166/1 "2006-11-15T06:22:37Z")

</div>

Hi guys,

I am trying to get flash to play a MC based on a variable that is passed through…

I have a switch statement which i think would be best to use however this does not work… so I guess it’s not… but you should be able to see what i’m trying to do with the code below.

I’m not sure if I need to have anything above this switch code to call the variable being passed through?

```auto

switch (page) {
 case 'index': 
  _root.mc_home.gotoAndPlay(2);
 case 'scout':
  _root.mc_scout.gotoAndPlay(2);
 case 'coaching':
  _root.mc_coaching.gotoAndPlay(2);
 case 'corner':
  _root.mc_corner.gotoAndPlay(2);
 case 'camps':
  _root.mc_camps.gotoAndPlay(2);
 default:
  _root.mc_home.gotoAndPlay(2);
 }

```

Any ideas… thanks heaps for any help.
