Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-24-2005, 11:00 PM   #1
P-town
Registered User
 
Join Date: Jan 2005
Posts: 11
Exclamation Where to put the unload MC script?

Hello, I have an mc in a box over the navagation bar. All other mcs load into this box over the nav bar, and I would like the viewer to have the "welcome.swf" file loaded in the box when the main index file loads. This means that I have to unload the "welcome.swf" from the main index file to make room for the new mcs that will be loaded from the links on the nav bar. Or else you see the "welcome.fla" file underneath the new mcs. Now, I've tried using levels in order to just load over it, and that worked, BUT when switching to a new mc on the nav bar you see the "welcome.fla" underneath it for a second. So, I need to know how to unload that mc, but most importantly, WHERE TO PUT THE SCRIPT, to unload the "welcome.fla" mc! Any suggestions? Thanks!
-P-town
PS- this is really the last thing I want to get done so I can publish the site! So please please please help me out!
P-town is offline   Reply With Quote
Old 01-25-2005, 01:36 AM   #2
Birdsong
Registered User
 
Join Date: Jun 2003
Location: NYC
Posts: 182
Default

use: MovieClip.removeMovieClip()

As documented in the flash dictionary: http://www.macromedia.com/support/fl...ionary564.html

Put it just before you load your other clips. that way you get rid of it first. The switch really should be instantaneous.
Birdsong is offline   Reply With Quote
Old 01-25-2005, 02:43 AM   #3
oldnewbie
Banned by AS.org Staff
 
Join Date: Mar 2002
Posts: 10,533
Default

Well you wouldn't be unloading a .fla but a .swf, so some confusion in your question.

Is the welcome.swf loaded in the same container clip as all other external movies?
oldnewbie is offline   Reply With Quote
Old 01-25-2005, 04:20 AM   #4
P-town
Registered User
 
Join Date: Jan 2005
Posts: 11
Default

Well, basically I just copied and pasted the welcome mc from the welcome swf. So I had the layout from the welcome.swf file, I then selected it all and turned it into an mc. Then I pasted that on the main index file's box over the nav bar. It's very archaic, but I am new to Flash and do not really understand the "duplicateMovieClip" command or any of the others I've been given. So, am I going to put the "removeClip()" command on the new swf files coming in? Or am I going to put it on the mc that loads them? Or the buttons on the nav bar? I am very confused here. Some more help would be great. Thanks
P-town is offline   Reply With Quote
Old 01-25-2005, 05:29 AM   #5
oldnewbie
Banned by AS.org Staff
 
Join Date: Mar 2002
Posts: 10,533
Default

Well, just remove it before attaching or duplicating a new movie clip, on the same script that is attaching or duplicating the new movie clip...
ActionScript Code:
on(release){ _level0.welcome_mc.removeMovieClip(); // your new attaching or duplicating code here... }

That said, unloadMovie should also work...

_level0.welcome_mc.unloadMovie();
oldnewbie is offline   Reply With Quote
Old 01-25-2005, 06:09 PM   #6
P-town
Registered User
 
Join Date: Jan 2005
Posts: 11
Unhappy

does it matter wether or not the mc is an external mc? And can I put that script on a button that loads something else? For instance the "news" button has the following script on it to load the swf:
ActionScript Code:
on(release){      mc_1.loadMovie("scrolltext1.swf"); }
should I put the removeClip script on that before the mc_1.loadMovie script? I don't use levels, I have an mc (called mc_1) on the main page loading the external swfs. I'm not sure how to use the duplicate mc script or where to put it. That is my main point. I have no idea where to put the script I've been given! I'm sorry I'm being so thick headed here, but, I just can't figure this out!

Last edited by CyanBlue; 01-25-2005 at 08:21 PM. Reason: AS tag is applied
P-town is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:52 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.