# Instance disappearing

**URL:** <https://forum.kirupa.com/t/instance-disappearing/291726>\
**Category:** Uncategorized\
**Created:** [July 3, 2009, 9:46pm UTC](https://forum.kirupa.com/t/instance-disappearing/291726 "2009-07-03T21:46:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prometheuz](https://avatars.discourse-cdn.com/v4/letter/p/f17d59/32.png) [@prometheuz](https://forum.kirupa.com/u/prometheuz)\
**Post date:** [July 3, 2009, 9:46pm UTC](https://forum.kirupa.com/t/instance-disappearing/291726/1 "2009-07-03T21:46:22Z")

</div>

Hi,

I am programming a bit dirty, hence it may be that I am doing something completely wrong. Any help with this greatly appreciated.

I have a scene (#2) where a view buttons are visible: REST, HUNT, CAST. They don’t do much currently but there are eventListeners defined for them when you enter the scene.

At one point, I jump to scene 4 using gotoAndStop(4); If I jump right back, everything is back to scene #2 and all is as it was.

But when I add a moveclip to scene 4 using the following lines:

_var xpx = (10+(32_(fight.plxpos[pld])));  
var ypx = (10+(32\*(fight.plypos[pld])));  
var newmon:Charset = new Charset();  
newmon.gotoAndStop(picrefs[MGV.party.pl[pld].pclass]);  
newmon.x = xpx;  
newmon.y = ypx;  
newmon.alpha = 1;  
**addChild(newmon); //this line causes the disappearance in the other scene, which is only noticeable way later when jumping back**  
newmon.addEventListener(MouseEvent.CLICK, fightclickinit);  
\*

This works fine in the scene, upon returning to scene 2 one of the buttons is gone. If I repeat the jumps another button is gone, then a background graphic etc. It seems like something to the effect of removeChildAt(0) is happening but I have NO removeChild lines whatsoever in scene 2, and even if I force a jump back right away I can see that it is the ADDING of this movieclips that causes the button (+other stuff if repeated) to disappear. Is there a limit of 2000 instances in AS3 ??

ANY IDEA what else I need to look out for?

Thanks,  
Volker
