# createEmptyMovieClip and createMask

**URL:** <https://forum.kirupa.com/t/createemptymovieclip-and-createmask/254590>\
**Category:** flash\
**Created:** [March 13, 2008, 1:05pm UTC](https://forum.kirupa.com/t/createemptymovieclip-and-createmask/254590 "2008-03-13T13:05:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Annie\_Weiss](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Annie\_Weiss](https://forum.kirupa.com/u/Annie_Weiss)\
**Post date:** [March 13, 2008, 1:05pm UTC](https://forum.kirupa.com/t/createemptymovieclip-and-createmask/254590/1 "2008-03-13T13:05:12Z")

</div>

Hello,

I am a nubbie to Flash, but am slowing learning on my own and am need of some HELP!!! I need to get this thing working soon and have been working on it for a few days!!!

I created an image gallery in Flash CS3 almost exactly the same to the following tutorial… [[COLOR=Blue]http://www.oman3d.com/tutorials/flash/imagegallery/[/COLOR]](http://www.oman3d.com/tutorials/flash/imagegallery/)

I need help trying to figure out how to make a mask for this gallery; I plan on importing this swf of the image gallery to another FLA file. Currently i tried importing this swf to the other FLA file, using loadMovie() and all thumbnails can be seen in a scrollable row without being masked.

This is the current script I am trying to use for the mask of the image gallery. It is embedded with the other script for the image gallery. It seems to be right to me but I can’t figure out why nothing is being shown:sen:.

[COLOR=Blue][COLOR=Black]Code:[/COLOR]  
function createMask() {

```
_root.createEmptyMovieClip("mask_mc",_root.getNextHighestDepth());

mask_mc._x = _root.myThumb_mc._x;
mask_mc._y = _root.myThumb_mc._y;

mask_mc.beginFill(0x000000,100);
mask_mc.lineTo(_root.myThumb_mc._width,0);
mask_mc.lineTo(_root.myThumb_mc._width,_root.myThumb_mc._width);
mask_mc.lineTo(0,_root.myThumb_mc._width);
mask_mc.lineTo(0,0);

container.setMask(mask_mc);

```

}

function scrolling() {  
\_root.onEnterFrame = function() {

```
    container._x += Math.cos(((mask_mc._ymouse)/mask_mc._width)*Math.PI)*10;

    if (container._x&gt;mask_mc._x) {
        container._x = mask_mc._x;
    }

    if (container._x&lt;(mask_mc._x-(container._width-mask_mc._width))) {
        container._x = mask_mc._x-(container._width-mask_mc._width);
    }

};

```

}[/COLOR]
