# Referencing dynamically attached nested movies

**URL:** <https://forum.kirupa.com/t/referencing-dynamically-attached-nested-movies/237598>\
**Category:** Uncategorized\
**Created:** [August 31, 2007, 8:08pm UTC](https://forum.kirupa.com/t/referencing-dynamically-attached-nested-movies/237598 "2007-08-31T20:08:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaRicardo](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@DaRicardo](https://forum.kirupa.com/u/DaRicardo)\
**Post date:** [August 31, 2007, 8:08pm UTC](https://forum.kirupa.com/t/referencing-dynamically-attached-nested-movies/237598/1 "2007-08-31T20:08:23Z")

</div>

long title, eh? that basically explains my question, though.

what now happens: a mask continuously reveals the area behind it, based on keyboard-based movement. (that part works). There is one mask clip (mask\_mc for lack of creativity), and whenever there is a key pressed, it looks like this:

_var a:MovieClip = mask\_mc.attachMovie(“mask”,“mask”+depth,depth);  
a.\_x = etc. etc._

later in the script, I need to start over with the blank mask. Possible solutions: reference the nested clips, and remove them all, or delete the whole clip and attach a new one. when I tried the latter, it just attached another version of the more complex mask. When i tried the first one, I could only figure out how to point to “undefined”

that didn’t seem to work… any suggestions or blatant errors on my part?
