# Multiple Masks for Dynamic Element Causing Null Object Reference

**URL:** <https://forum.kirupa.com/t/multiple-masks-for-dynamic-element-causing-null-object-reference/297186>\
**Category:** flash\
**Created:** [September 27, 2009, 12:09pm UTC](https://forum.kirupa.com/t/multiple-masks-for-dynamic-element-causing-null-object-reference/297186 "2009-09-27T12:09:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Plasmic\_Steve](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/plasmic_steve/32/361_2.png) [@Plasmic\_Steve](https://forum.kirupa.com/u/Plasmic_Steve)\
**Post date:** [September 27, 2009, 12:09pm UTC](https://forum.kirupa.com/t/multiple-masks-for-dynamic-element-causing-null-object-reference/297186/1 "2009-09-27T12:09:08Z")

</div>

Hello.

I have a bunch of objects that each contain a color swatch movie clip. The color swatch contains a bunch of frames, each a different colored rectangle.

The objects that contain the swatch clips also have a mask layer that defines what portion of the color swatch is revealed.

When I have one frame in that mask, everything works correctly. I can change the swatches with no problem.

However, I need to create different frame for the mask. Once I create a second frame with a different mask, I get a Null Object Reference and everything breaks.

I tried creating shape tweens between the frames, making each mask into its own movie clip, and putting each new mask on a different layer - but none of that works.

How can this be fixed?
