# Setting AddChild to be a background

**URL:** https://forum.kirupa.com/t/setting-addchild-to-be-a-background/264598
**Category:** flash
**Created:** [June 27, 2008, 5:29pm UTC](https://forum.kirupa.com/t/setting-addchild-to-be-a-background/264598 "2008-06-27T17:29:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![thejoeknows\_com](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@thejoeknows\_com](https://forum.kirupa.com/u/thejoeknows_com)
#### Post date: [June 27, 2008, 5:29pm UTC](https://forum.kirupa.com/t/setting-addchild-to-be-a-background/264598/1 "2008-06-27T17:29:29Z")

</div>

when trying to set a movieclip as an addchild, my hero still goes under it instead of walking on it.

i hav tried…

```auto

addChild(level.mc.building); //where level.mc is the level and building is its background

```

and ive tried

```auto

hero.mc addChild(level.mc.building); //where hero.mc is the character

```

in both versions the hero walks under the movieclip

any suggestions?

---

<div class="post-metadata">

### Author: ![yaim0310](https://avatars.discourse-cdn.com/v4/letter/y/85e7bf/32.png) [@yaim0310](https://forum.kirupa.com/u/yaim0310)
#### Post date: [June 27, 2008, 6:51pm UTC](https://forum.kirupa.com/t/setting-addchild-to-be-a-background/264598/2 "2008-06-27T18:51:23Z")

</div>

```auto
setChildIndex(hero,numChildren);

```

change the index of your child objects… 0 is the back and last number is front. so if you always want your hero to be on top keep his index last. but if you want to have him go behind stuff, say like a tree, set the hero’s index after the tree, so the tree is say a 4 so put the hero a 3 or less.

edit: lol oops had my numbers mixed up

---

<div class="post-metadata">

### Author: ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)
#### Post date: [June 27, 2008, 8:16pm UTC](https://forum.kirupa.com/t/setting-addchild-to-be-a-background/264598/3 "2008-06-27T20:16:30Z")

</div>

Can you show a graph of Ur clips structure?  
Anyway, maybe the simplest solution will be the best

```auto
addChild(hero);

```
