# Applying setMask to one level but not other ones below

**URL:** https://forum.kirupa.com/t/applying-setmask-to-one-level-but-not-other-ones-below/72046
**Category:** flash
**Created:** [December 1, 2004, 8:31pm UTC](https://forum.kirupa.com/t/applying-setmask-to-one-level-but-not-other-ones-below/72046 "2004-12-01T20:31:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![orlando2004](https://avatars.discourse-cdn.com/v4/letter/o/b5ac83/32.png) [@orlando2004](https://forum.kirupa.com/u/orlando2004)
#### Post date: [December 1, 2004, 8:31pm UTC](https://forum.kirupa.com/t/applying-setmask-to-one-level-but-not-other-ones-below/72046/1 "2004-12-01T20:31:18Z")

</div>

I am using the following code to generate a television unit that will load in various SWF files and obviously, I want to mask the viewing area of the television ONLY. The SWF is loaded on level 4, while the panel and buttons appear on lower levels. Problem is when I attach a mask from the library to the movieclip containing the SWF, nothing happens.

Here is my code…whats wrong with my final section (MASK)???

_//create empty movieclips to hold contents:_  
_//_\*\*\*\* DYNAMIC PANEL - Level 1 \*\*\*\*\*\*  
_myExpanded = this.createEmptyMovieClip(“expandedContainer”, 1); \*  
 expandedContainer.attachMovie(“expandedPanel”, “expanded\_mc”, 1)  
 //_\*\*\* TINT - Level 2 \*\*\*\*\*\*  
_myTint = this.createEmptyMovieClip(“tintContainer”, 2);_  
_tintContainer.attachMovie(“rectangle”, “tint\_mc”, 2, {\_x:PaneX, \_y:PaneY, \_width:PaneWidth, \_height:PaneHeight});_  
_//_\*\*\*\* DYNAMIC TITLE - Level 3 \*\*\*\*\*\*  
_myTitle = this.createEmptyMovieClip(“titleContainer”, 3)_  
_titleContainer.attachMovie(“title\_eforms”, “eforms\_mc”, 3, {\_x: 6, \_y:1});_  
_//_\*\*\*\* LOAD MOVIE - Level 4 \*\*\*\*\*\*  
_myMovie = this.createEmptyMovieClip(“movieContainer”, 4)_  
_movieContainer.loadMovie(“d\_index.swf”, 4);_  
_movieContainer.\_x=PaneX;_  
_movieContainer.\_y=PaneY;_  
_//_\*\*\*\* CREATE MASK AND ATTACH IT TO TARGET CLIP\*  
\*myMovie.attachMovie(“tempMask”, “moviemask\_mc”, 5, {\_x:PaneX, \_y:PaneY, \_width:PaneWidth, \_height:PaneHeight}); \*  
_//use setMask to provide the viewable area of the container, NOT THE CONTENT_  
_myMovie.setMask(moviemask\_mc);_
