# Bitmap disappear after setChildIndex

**URL:** <https://forum.kirupa.com/t/bitmap-disappear-after-setchildindex/287404>\
**Category:** Uncategorized\
**Created:** [April 30, 2009, 3:22pm UTC](https://forum.kirupa.com/t/bitmap-disappear-after-setchildindex/287404 "2009-04-30T15:22:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ookla](https://avatars.discourse-cdn.com/v4/letter/o/258eb7/32.png) [@ookla](https://forum.kirupa.com/u/ookla)\
**Post date:** [April 30, 2009, 3:22pm UTC](https://forum.kirupa.com/t/bitmap-disappear-after-setchildindex/287404/1 "2009-04-30T15:22:49Z")

</div>

I have a bitmap inside a Movieclip. So, when I swap the parent, the bitmap disappears… This is my setup:

ScreenMC Children:  
0. name:instance178 type:object [object Sprite]

1. 

```
name:instance176 type:object [object MovieClip]

```

2. 

```
name:instance16 type:object [object Bitmap]

```

After this:

\_currentScreen = \_Container.getChildByName(some\_string) as ScreenMC;  
\_Container.setChildIndex(\_currentScreen,Number(\_Container.numChildren - 1));

Than, I load another ScreenMC object, and when I swap back the first ScreenMC, I get this:

ScreenMC Children:  
0. name:instance178 type:object [object Sprite]

1. 

```
name:instance176 type:object [object MovieClip]

```

On ScreenMC, I have this:

\_bgBitmap = new Bitmap();  
\_bgBitmap = Main.bgsDictionary[“bg1.jpg”] as Bitmap; // grab Bitmap object from a dictionary  
\_bgHolderMc.addChild(\_bgBitmap);

Why?

Thanks
