# SetChildIndex Question

**URL:** <https://forum.kirupa.com/t/setchildindex-question/285442>\
**Category:** flash\
**Created:** [March 31, 2009, 8:51pm UTC](https://forum.kirupa.com/t/setchildindex-question/285442 "2009-03-31T20:51:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skelebunny](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@skelebunny](https://forum.kirupa.com/u/skelebunny)\
**Post date:** [March 31, 2009, 8:51pm UTC](https://forum.kirupa.com/t/setchildindex-question/285442/1 "2009-03-31T20:51:46Z")

</div>

Hi,

I have a movieclip that I bring forward to the top layer and have it play when you click a nav button. I want the same movie clip that is triggered to go back to it’s original position once it’s done playing. It’s original position is behind the buttons. This is what I have but I can’t seem to get it to get back to it’s original position.

```
ActionScript Code:
[LEFT][COLOR=#000000] **function** [/COLOR] blackGo[COLOR=#000000]([/COLOR][COLOR=#0000FF]e[/COLOR]:MouseEvent[COLOR=#000000])[/COLOR]:[COLOR=#0000FF]void[/COLOR]

```

[COLOR=#000000]{[/COLOR]  
setChildIndex[COLOR=#000000]([/COLOR]black, numChildren -[COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];  
black.[COLOR=#0000FF]play[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#0000FF]if[/COLOR][COLOR=#000000]([/COLOR]black.[COLOR=#000080]currentFrames[/COLOR] == black.[COLOR=#000080]totalFrames[/COLOR][COLOR=#000000])[/COLOR]  
[COLOR=#000000]{[/COLOR]  
setChildIndex[COLOR=#000000]([/COLOR]black, [COLOR=#000080]0[/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[/LEFT]

Any help is appreciated!
