# Multiple mc control to avoid layering

**URL:** <https://forum.kirupa.com/t/multiple-mc-control-to-avoid-layering/296097>\
**Category:** flash\
**Created:** [September 9, 2009, 3:09pm UTC](https://forum.kirupa.com/t/multiple-mc-control-to-avoid-layering/296097 "2009-09-09T15:09:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theptsman](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@theptsman](https://forum.kirupa.com/u/theptsman)\
**Post date:** [September 9, 2009, 3:09pm UTC](https://forum.kirupa.com/t/multiple-mc-control-to-avoid-layering/296097/1 "2009-09-09T15:09:13Z")

</div>

Help…

I have lost enough hair over this site to make a replica chia pet of myself.

In a scene I have 8 MC’s each MC has a stop() on frame one and frame ten.

on click the MC plays till frame ten ( moving into the scene ) then waits for

another click to return to its original location.

Here is a visual,

[CENTER] ![](http://cid-641eeeb28a66c20b.skydrive.live.com/self.aspx/.Public/zodiac/example1.jpg) ![](http://cid-641eeeb28a66c20b.skydrive.live.com/self.aspx/.Public/zodiac/example2.jpg)[/CENTER]

Right now I am using this script.

```auto
 
import flash.display.MovieClip;
import flash.events.MouseEvent;
 
sign1movie.addEventListener(MouseEvent.CLICK, onClickHandler11);
sign1movie.buttonMode = true;
sign1movie.useHandCursor = true;
 
sign1button.addEventListener(MouseEvent.CLICK, onClickHandler11);
sign1button.buttonMode = true;
sign1button.useHandCursor = true;
function onClickHandler11(myEvent:MouseEvent){ 
sign1movie.play(); 
}
 

```

it’s pretty simple I have hit points (sign1button) due to the overlapping of images,

Problem is I need to have the MC play so that only one MC is on the stage at a time,

right now they over lap in their respective layer.

I tried… and failed…

```auto
 
var signstate:String = "empty";
 
import flash.display.MovieClip;
import flash.events.MouseEvent;
 
sign1movie.addEventListener(MouseEvent.CLICK, onClickHandler11);
sign1movie.buttonMode = true;
sign1movie.useHandCursor = true;
 
sign1button.addEventListener(MouseEvent.CLICK, onClickHandler11);
sign1button.buttonMode = true;
sign1button.useHandCursor = true;
function onClickHandler11(myEvent:MouseEvent){ 
 
if (signstate==empty) { 
sign1movie.play(); 
} 
else { 
signstate.play() //I want it to goto and play which mc changed the variable.
}
 

```

and in the MC (sign1movie) @ frame ten I have

```auto
 
stop()
 
var signstate:String = "sign1movie";
 

```

But all I get is errors, is their a simpler way? what am I doing wrong.

I know signstate.play() won’t work. I wish it did…

When I set all my Mc’s to have

var signstate:String = “sign1movie”; // in sign1movie

var signstate:String = “sign2movie”; // in sign2movie

var signstate:String = “sign3movie”; // in sign3movie

flash freaks out or can’t find the variable, is this because it’s in a movie clip?

I worked so hard on all the other AS3 coding for the site but this seems soo simple

I just can’t figure it out…

Any help would be greatly appreciated.
