# Play to and stop (character movement MC)

**URL:** <https://forum.kirupa.com/t/play-to-and-stop-character-movement-mc/57859>\
**Category:** flash\
**Created:** [July 16, 2004, 9:03pm UTC](https://forum.kirupa.com/t/play-to-and-stop-character-movement-mc/57859 "2004-07-16T21:03:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![polishbroadcast](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@polishbroadcast](https://forum.kirupa.com/u/polishbroadcast)\
**Post date:** [July 16, 2004, 9:03pm UTC](https://forum.kirupa.com/t/play-to-and-stop-character-movement-mc/57859/1 "2004-07-16T21:03:41Z")

</div>

Hello helpful flash friends. I need some help or a glass of water thrown in my face.

I have a MC which is a lady that raises her arms up and down. From the main timeline i want to tell that “ladyMC” (also sitting on the main timeline) to play to and stop on specific frames. I have tried it two different ways but am obviously missing something.

The first way i tried just using an if/else and getting the current frame #.

```auto
if(lady._currentframe < 22){
    	lady.play();
	}else if(lady._currentframe >= 22){
   		lady.stop();
}

```

The second way i tried setting a variable (which is being passed successfully) so that when the ladyMC hits the frame i want it to stop on, it changes the variable.

```auto
lady.play();

	
if(ladyvar==2){
   		lady.stop();
}

```

In both examples, the ladyMC plays through and never stops. Your help is appreciated. This seems so simple but is driving me crazy.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 17, 2004, 1:47am UTC](https://forum.kirupa.com/t/play-to-and-stop-character-movement-mc/57859/2 "2004-07-17T01:47:27Z")

</div>

For your first example, make sure the actionscript is being called consistently. If its on the main stage and you only have one frame there, it is only executing the code the first time. (so, the \_currentframe then would probably be like 1, so it plays…then doesnt re-evaluate \_currentframe). Not sure if this is your situation.

To solve this, you would need to stick the code in a function and use setInterval or a MC with two frames where there is AS on one and not the other, with no stop(). This will call the code at half your framerate.

I think thats all right…correct me if not.

You might also try a nap.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 3, 2004, 8:38pm UTC](https://forum.kirupa.com/t/play-to-and-stop-character-movement-mc/57859/3 "2004-08-03T20:38:56Z")

</div>

Thanks so much for the reply. I solved it by putting the code on the MC itself and that seems to work great. I appreciate the response!
