# Check attached movie's target

**URL:** <https://forum.kirupa.com/t/check-attached-movies-target/162592>\
**Category:** flash\
**Created:** [September 14, 2005, 4:06pm UTC](https://forum.kirupa.com/t/check-attached-movies-target/162592 "2005-09-14T16:06:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaredcunha](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jaredcunha](https://forum.kirupa.com/u/jaredcunha)\
**Post date:** [September 14, 2005, 4:06pm UTC](https://forum.kirupa.com/t/check-attached-movies-target/162592/1 "2005-09-14T16:06:16Z")

</div>

I have these slides, which are movie clips. The slides have a function that automatically moves to the next slide when it is complete.

slides.attachMovie(slideShow\*, “slide”, 1);

lastImage.attachMovie(slideShow[i-1], “slideOut”, 1);

The code above is just how the slides are attached. There is quite a bit in between. The slide is first attached in a movie clip titled “slides”, when it is done, it is attached to the movie clip titled “lastImage”.

I would like the function to run while the movie clip is loaded in “slides”, but not when it is loaded in “lastImage”. I’m thinking I should use an if statement (correct me if I’m wrong). I just don’t know the code. Oh, and the function is declared in the main timeline.

Should be along the lines of:

\_global.autoAdvance = function (){  
if (movie is currently playing in “slides”){  
do some actions;  
}  
}

Any help would be soooo much appreciated.
