# Can't you change the reference of an obj after "addChild"?

**URL:** <https://forum.kirupa.com/t/cant-you-change-the-reference-of-an-obj-after-addchild/284760>\
**Category:** flash\
**Created:** [March 23, 2009, 12:50pm UTC](https://forum.kirupa.com/t/cant-you-change-the-reference-of-an-obj-after-addchild/284760 "2009-03-23T12:50:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangxiaorui](https://avatars.discourse-cdn.com/v4/letter/z/e495f1/32.png) [@zhangxiaorui](https://forum.kirupa.com/u/zhangxiaorui)\
**Post date:** [March 23, 2009, 12:50pm UTC](https://forum.kirupa.com/t/cant-you-change-the-reference-of-an-obj-after-addchild/284760/1 "2009-03-23T12:50:06Z")

</div>

Well, see this simple example:

```auto
var a:Bitmap = someExternalBitmap;
addChild(a);
a = someOtherExternalBitmap;

```

So this above is not working, but you need to invoke the “addChild” again to let it work (see the underlined one):

```auto
var a:Bitmap = someExternalBitmap;
addChild(a);
a = someOtherExternalBitmap;
[U]addChild(a);[/U]

```

Is that the right way? I personally think it’s a little weird.
