I have tried to grasp this concept, but cannot believe the cluster F that as3 has done with loading a swf and then removing it.
Whereas in As2, you would simply loadMovie into a movieClip’s instance name. If you wanted it gone, you could simply replace it with something new, or unloadMovie. Simple.
Now…to even load a movie in…you have to create variables, create a movie clip, create a loader, then create a url request, then load that url request into the loader, then addchild so that the loader is on the stage??? Are you serious with this? And to remove it, is next to impossible.
So here is my code…
function loadMovie (){
var my_mc:MovieClip = new MovieClip();
var my_Loader:Loader = new Loader();
my_mc.addChild(my_Loader);
addChild(my_mc);
var my_url:URLRequest=new URLRequest(“pic1.swf”);
my_Loader.load(my_url);
my_mc.x = 206;
my_mc.y = 100;
}
function removeMovie():void
{
removeChild(my_Loader);
}
That code when tested gives me…Error #2025: The supplied DisplayObject must be a child of the caller. When I try to run the removeMovie function.
I don’t know why. I can’t understand how and why this error is coming up.
Please for the love of god, can you help me to understand.
Thanks