Unloading a movie container?

I have created a main page that has a scrollable news section on it in the center. I have a members link that when you press, loads a movie into a container right over the news section. I put the action script on the buttons layer this is the code…

members.onPress = function () {
_root.createEmptyMovieClip(“container”, 1);

loadMovie("membersmovie.swf", "container");
container._x = 164 ;
container._y = 270 ;

}

This part works fine. Only problem is once i load the members movie on top of the news i want to be able to take it off like its unloading when i press my Home button , or hit another button which i might make on the new movie thats loaded.

What actionscript command would i use to unload this movieclip, and would it be better for it to be put in the frame or should it be put on the actions of the button itself …

You can check the test page at.

www.geocities.com/neo23j/index2.html
or
http://www.geocities.com/neo23j/index2.swf

the fla is at
www.geocities.com/neo23j/index2.fla

Thanks.

You would use unloadMovie (“container”);

Make sure you target container correctly.

How do i target a container ? what other paramters are needed in the script…

would it be.

unloadmovie (“container”, 1):

No. Use:

For a button:

on (release) {
_root.container.unloadMovie();
}

Im totally confused now. Oh well.

I dont see where in that script it tells which container to unload. also i didnt use _root in my load script, not sure what it does really. Im still kinda newbish when it comes to action scripts.

Sorry :*(

I’ll look at your fla - one sec…

My bad, i did use _root in the load. This just shows you how tired i am. I cant think straight. I dont think you needed to download the fla at all. Just check the code i put up on the first post. Ill try and see what i can do with the info you gave me. thanks

It’s you again - I helped you with the password business

This is the button you have on your home button:


on (release) {
getURL("http://ultarius.com/AoS/");
}

Add this to it:


on (release) {
_root.container.unloadMovie();
getURL("http://ultarius.com/AoS/");
}

If that works add the code to all your buttons except members, because that creates and positions container.

Hmmm happened again - typing a post and they post before me.

Yes, watch out for Mr. _root.

Yep its me again :stuck_out_tongue: . I working on different parts of the page in a weird order. So i have not fully worked out the pw thing yet, but thanks again for helping me with it. it gave me a great idea on how to use it to load another movie which will contain what i want. =)

I tried that code with out the Get Url , just the unload movie and it didnt work. Thing is, i dont want it to have to reload the whole page if i dont have to , i rather just unload that movie and have the page just stay flush, instead of loading on browser again.

Tried your code. tried mine, then tried another solution and put this in the same frame as the load code…

home.onPress = function () {
_root.unloadMovie(“container”, 1);

unloadMovie(“membersmovie.swf”);
}

Didnt get any syntax errors so i thought it might work. But it didnt do anything when i tried it on preview publisher.

You’re confusing the code there!

And if you’re loading into a move clip - don’t use levels like you’re doing:

home.onPress = function () {
_root.unloadMovie(“container”, 1); // get rid of container and 1
unloadMovie(“membersmovie.swf”); // and this line
}

You don’t need to unload membersmovie.swf. When you _root.container.unloadMovie(); it unloads whatever is in the container.

EDIT: The above code should read

home.onPress = function () {
_root.unloadMovie();
}

I dunno. I tried everything. I tried the home.onpress from the first frame. I tried it on the button. I tried it with out the instance name and just having the action on the button. None of it seems to unload the movie. I give up for tonight. Thanks for trying to help man.

Anyone out there that knows what im doing wrong ? The fla and the code i used on the button layer are on first post.

When i publish preview hitting the home button does nothing. Can anyone tell me what i need to do get it to unload the movie . Please. I just want to get past this so i can move onto more things .

If you left the code for the members button as it was, and just ad the code (1 line) I gave you to what you already have in the other buttons, like home, it should work. I’ll have to check your fla again to see what it was.

The code i originally had which is still there for the members button always worked. It was not a button script. It was on the layer with the rest of the buttons and had instance name to the members button.

members.onPress = function () {
_root.createEmptyMovieClip(“container”, 1);

loadMovie(“membersmovie.swf”, “container”);
container._x = 164 ;
container._y = 270 ;
}

Thats the code. There is no other code on that layer / frame.

Then i tried a million things for the Home button code. I tried putting it on the button itself, on the button layer under the members code. Tried putting it on the first layer “actions” in the frame. Under the stop action script and over it. Tried with a instance name and with out. All of them have produced the same exact thing. Nothing ! It doesnt unload the movie it doesnt reload the page with the movie, it does nothing at all.

Haven’t had a chance to have a look at the fla again yet - I’ll have a look when I can - unless it’s sorted by then.

If you could figure this out it would be cool. I just dont want you to take this all on yourself. It seems your the only one around here checking up on other peoples fla and helping them out.

Wish others would be able to put half the effort . hehe, If i knew flash better i know i would help out as much as you do. Or try to atleast. Anyway, if your busy and stuff dont worry about it. Ill keep digging …

I got caught up in something. I’ll a look a the fla when I can and if I come up with anything I’ll post it here.

I’ll have a look at the fla, although the chances of me figuring out whats wrong are one in a million… acturally… make that 0 in 1.