I’ve tried a couple different ways to try and get my swf to unload and it just will not do it.
I’ve got a swf that loads another swf into it fine.
I then have an image on that loaded in swf that is a movie clip; that just shows a bigger sized image of the previous thumbnail that was on the main swf.
I made the movieclip into button mode and wanted it to just upon click remove the child so it goes back to the thumbnails view of the main swf.
I’ve tried simply adding it as a child then just using the removeChild() and that wouldn’t work.
I also tried making the actual image in the loaded swf into a button to see if it was just me using it as a movie clip and that wouldn’t work.
I then tried to just put a seperate button on the loaded in swf to control the function of removing the child and that won’t work either.
Now i’ve tried making a container and adding the swf into the container so i can use the container.removeChild(); and that doesn’t work either.
Any ideas?
Here is my main swf that loads the external swf. (which loads it fine)
I’m using this in conjunction with papervision3d 2.0 if anyone is wondering what face refers to. It’s apart of my geometry for one of my primitives.
//Set Variables
var face1Request:URLRequest = new URLRequest("big.swf");
var face1Loader:Loader = new Loader();
var container:Sprite = new Sprite();
//Upon clicking on the face(s) let them respond accordingly
face.addEventListener(MouseEvent.CLICK, face1);
function face1(event:MouseEvent):void {
addChild(container);
face1Loader.load(face1Request);
container.addChild(face1Loader);
face1Loader.x = 0;
face1Loader.y = 0;
}
Here is external swf code. I changed it back to the movieclip being able to unload the child. And yet it won’t trace the click out and doesn’t seem to become active as in button mode with removeChild added in the function.
But once i remove that code in the fuction, it becomes active and lets me click the movie clip in button mode and will trace out click … ?? What the hell am i doing wrong; i feel it’s something simple and it’s driving me nutts!
big_mc.buttonMode = true;
big_mc.addEventListener(MouseEvent.CLICK, getOut);
function getOut(event:MouseEvent):void
{
trace ("Click!")
container.removeChild(face1Loader);
}