[AS3] erase Loaders if they exist ?
Hello (excuse my bad english / I'm an ol french)
I load a lot of ".swf" during the main, like this :
var conteneurImage2:Loader = new Loader();
var image2:URLRequest = new URLRequest("test/intro.swf");
conteneurImage2.load(image2);
this.addChild(conteneurImage2);
I want to erase the loaders, like this
conteneurImage2.unloadAndStop();
removeChild(conteneurImage2);conteneurImage2 = null;
conteneurImage2.visible = false;
But sometimes, some loaders don't exist. I know I need to use the function "if", but I don't succeed. I try this
if (conteneurImage2)
{conteneurImage2.unloadAndStop();
removeChild(conteneurImage2);conteneurImage2 = null;
conteneurImage2.visible = false;}
or this :
if (conteneurImage2 != null;)
{conteneurImage2.unloadAndStop();
removeChild(conteneurImage2);conteneurImage2 = null;
conteneurImage2.visible = false;}
It doesn't work. The loader is not deleted.
I thank you very much.
