# CreateEmptyMovieClip not working?

**URL:** <https://forum.kirupa.com/t/createemptymovieclip-not-working/184798>\
**Category:** flash\
**Created:** [April 7, 2006, 10:44pm UTC](https://forum.kirupa.com/t/createemptymovieclip-not-working/184798 "2006-04-07T22:44:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Menno](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Menno](https://forum.kirupa.com/u/Menno)\
**Post date:** [April 7, 2006, 10:44pm UTC](https://forum.kirupa.com/t/createemptymovieclip-not-working/184798/1 "2006-04-07T22:44:18Z")

</div>

Hi,

I’am having troubles with the CreateEmptyMovieClip on my website.  
I made the following script in a new document with just a button and an image.

This is the code in the button:

```auto

on (press) {
gotoAndStop(2);
createEmptyMovieClip("container",1);
container.loadMovie("0319L.jpg");
container._x = 0 ;
container._y = 70 ;
}

```

This is the code on the first frame:

```auto

_root.onMouseDown = function () { 
removeMovieClip ("container") ;
gotoAndStop(1);
}

```

Frame 2 is just an empty frame so I don’t have a problem with the button beeing under the image.

My target is to open an external JPG image in an empty ‘container’ which closes itself after you click it. In this new document it works fine.

When I use the same codes in my website the image does not seem to load in the ‘container’. The removeMovieClip command works so the ‘container’ does load.  
Main difference in my website is that the button is placed in a mc that is displayed with the attachMovie command.

My website adress is [URL=“http://www.lumivo.nl”]www.lumivo.nl At this moment the tumbnails are opened in pop-up windows. I would like the images to open in the flash movie itself as some browsers with high security settings don’t allow my pop-up windows at this moment.

I hope that I make any sense, as I’am a complete beginner in Flash.

Thanks!  
Menno

---

<div class="post-metadata">

**Author:** ![mprzybylski](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mprzybylski/32/613_2.png) [@mprzybylski](https://forum.kirupa.com/u/mprzybylski)\
**Post date:** [April 7, 2006, 10:46pm UTC](https://forum.kirupa.com/t/createemptymovieclip-not-working/184798/2 "2006-04-07T22:46:42Z")

</div>

i’m pretty sure its a scoping problem. use \_root or whatever timeline you want to create the empty mc on and make sure you always refer to it properly.

secondly, centralize your code (don’t put code on buttons, but on the timeline, and preferably in one frame if you can). it makes scoping issues easier to deal with.
