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.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
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?