# Determining which \_levels are occupied

**URL:** https://forum.kirupa.com/t/determining-which--levels-are-occupied/267220
**Category:** flash
**Created:** [July 29, 2008, 9:08pm UTC](https://forum.kirupa.com/t/determining-which--levels-are-occupied/267220 "2008-07-29T21:08:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![thalamus](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@thalamus](https://forum.kirupa.com/u/thalamus)
#### Post date: [July 29, 2008, 9:08pm UTC](https://forum.kirupa.com/t/determining-which--levels-are-occupied/267220/1 "2008-07-29T21:08:46Z")

</div>

Trying to write a function on \_level0 that will let me find out if any Flash movies are loaded on \_level1, \_level2, etc. using loadMovieNum.

for example, in \_level0; if I:  
loadMovieNum (“movie2.swf”, 2);  
loadMovieNum (“movie3.swf”, 3);  
function();

… this function would tell me that no SWF has been loaded into \_level1 (unoccupied).  
(for… in, perhaps?) I tried to use getInstanceAtDepth(N); but returns undefined as I don’t think it works with loadMovieNum.

**BACKSTORY** : I have several \_levels representing pages of content that lay on top of each other. When I loadMovieNum(“movie5.swf”, 5); I don’t want user to be able to click on movie clips (onPress) on \_level4, which are hidden behind \_level5.

I don’t necessarily want to kill \_levels 1 - 4 before loading \_level5; want user to be able to close \_level5 and go back to \_level4, e.g.

I know how to disable/hide on case-by-case basis, but I’m trying to develop and call a global function on \_level0 that will look for occupied \_levels and disable/hide the appropriate movie clips on each level and cut down on scripting, since not all levels 0 to N will be occupied in every case.
