I'm having this error in which I have a Main Menu scene, an Options scene, and a game scene. I have a external file which holds all the public variables that I need between scenes. In the game, there is a picture of water in the background which is purely decorative and doesn't do anything, the only time I use it in code is when I'm moving it to the back so other platforms can be positioned on top of it by using the code:
setChildIndex(gfxWater, 1);
This used to work before I put the options scene in, and still does, provided I don't go to the options scene. Even if I don't touch anything on the options scene, simply going there causes this line to throw a "Parameter Child must be non-null" error. I tried to trace gfxWater right beforehand, but just got null. I simply dragged the water onto the screen to create it and gave it the instance name gfxWater. I don't understand how that could be null, its still there even when this line breaks, it's just on top of everything else.
In the options menu I am not doing anything with the water, I'm only changing variables such as whether or not to play music or sound effects, stuff like that. Nothing relative to the water. The only thing that I can think of that might be causing a problem is that I used a custom font in the options scene, so I had to create the text in AS3. Before I transition back to the main menu though, I make sure to remove the text. That code is here:
//This Removes The Text
for (m = 0; m < optionsTextArray.length; m++){
optionsTextArray[m].parent.removeChild(optionsTextArray[m]);
}
optionsTextArray.splice(0, optionsTextArray);
//This Hides The Images
soundFxCheck.parent.removeChild(soundFxCheck);
soundFxX.parent.removeChild(soundFxX);
musicCheck.parent.removeChild(musicCheck);
musicX.parent.removeChild(musicX);
codeCheck.parent.removeChild(codeCheck);
codeX.parent.removeChild(codeX);
//This Transitions To The Main Menu
gotoAndPlay("menuStart", "Main_Menu");
Any help with this issue would be greatly appreciated. Also just for reference I am using AS3 on CS3 (Sorry, my school is a little out of date). Thanks in advance!