# Poms Code

**URL:** <https://forum.kirupa.com/t/poms-code/10168>\
**Category:** flash\
**Created:** [December 26, 2002, 5:22am UTC](https://forum.kirupa.com/t/poms-code/10168 "2002-12-26T05:22:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bellir](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@bellir](https://forum.kirupa.com/u/bellir)\
**Post date:** [December 26, 2002, 5:22am UTC](https://forum.kirupa.com/t/poms-code/10168/1 "2002-12-26T05:22:12Z")

</div>

but.onPress = function () {  
\_root.createEmptyMovieClip(“container”, 1);  
loadMovie(“loaded.swf”, “container”);  
container.\_x = 150 ;  
container.\_y = 20 ;  
}

The above code works great to create empty movie clips on the fly, but I’m having a problem with my scenes.

Once I click on a button, the movie clip will play fine. But when I click on something else, the movie clip keeps playing. And then everything becomes a mess…

Can anyone help me out?  
tks  
bellir

---

<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:** [December 26, 2002, 5:55am UTC](https://forum.kirupa.com/t/poms-code/10168/2 "2002-12-26T05:55:36Z")

</div>

Don’t recreate your clip with every press, try this instead… (don’t know if it will work, it is untested and it is 1am, and I am tired…lol.

```auto
_root.createEmptyMovieClip("container", 1);

```

```auto
but.onPress = function () {
loadMovie("loaded.swf", _root.container);
_root.container._x = 150 ;
_root.container._y = 20 ;
}

```

---

<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:** [December 26, 2002, 10:09am UTC](https://forum.kirupa.com/t/poms-code/10168/3 "2002-12-26T10:09:03Z")

</div>

Well, the movie clips go on playing until you tell them to stop, Bellir. Either by stopping them, or removing them.

pom \<:}
