# On clip event enter frame question

**URL:** <https://forum.kirupa.com/t/on-clip-event-enter-frame-question/320339>\
**Category:** flash\
**Created:** [March 21, 2011, 5:31am UTC](https://forum.kirupa.com/t/on-clip-event-enter-frame-question/320339 "2011-03-21T05:31:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@Dave](https://forum.kirupa.com/u/Dave)\
**Post date:** [March 21, 2011, 5:31am UTC](https://forum.kirupa.com/t/on-clip-event-enter-frame-question/320339/1 "2011-03-21T05:31:50Z")

</div>

Hi Guys,

I have two buttons and a light blue circle. When you press the second button from the left, it changes the variable name to “boxTwo”.

In the circle video clip I have a enterframe with a condition to say, if the name is “boxTwo” play an animation, but it doesn’t work. Anyone know why?

Button:

```auto

on(release){
	var name = "boxTwo";
	_root[name].gotoAndStop(12);
	trace(name);
}

```

On the circle MC that contains the animation

```auto

onClipEvent(enterFrame){
	trace(_root.name);
	if(_root.name == "boxTwo"){
		circle.gotoAndPlay("loop");
	}
}

```

Any ideas? Thanks 🙂
