Skip to main content
Known Participant
April 5, 2008
Question

Empty parent movieclip from child swf

  • April 5, 2008
  • 15 replies
  • 848 views
I am very new at this stuff.

My parent swf has a movie clip with a png file in it. (E.G. myMCL.loadClip("master2.png", "empty1"); )

When I play another swf overtop, the png shows underneath as my new movie clip loads. Can I "unloadclip" in the master (parent) from my other child swfs before loading a new movie clip so that you will not see the png file? I have tried unsuccesssfully thus far.

Thank you in advance.

This topic has been closed for replies.

15 replies

Known Participant
April 6, 2008
Thanks again kglad.

Forrest
kglad
Community Expert
Community Expert
April 6, 2008
yes. you can either execue:

this.removeMovieClip();

on the last frame of the movieclip or start a loop that repeatedly checks if the movieclips _currentframe is equal to its _totalframes.
Known Participant
April 6, 2008
Thank you kglad. I appreciate all your time on this one.

In a different direction...

Is there a way to have a movieclip that is playing on stage just close itself when it has finished playing. like disappear?
kglad
Community Expert
Community Expert
April 6, 2008
place it where needed and execute it when needed. but you'll need to use the correct path to myMCL and empty1 IF you place that unloadClip() method on another timeline.
Known Participant
April 6, 2008
Thank you kglad. When I put that in the same timeline it loads and unloads so quick, you do not get to see the png on the master swf page.

I want the png to display and disappear only when calling another swf page to load another movie clip in that container.
kglad
Community Expert
Community Expert
April 6, 2008
then:

myMCL.unloadClip(empty1);

executed from the same timeline that contains that loadClip() statment will unload your png, IF loading (of the png) is complete.
Known Participant
April 6, 2008
When you click on the "Back to main button", it reloads to display the master swf complete with png.

My small container on the master swf has this code...

myMCL.loadClip("master2.png", empty1);
kglad
Community Expert
Community Expert
April 6, 2008
once your png is unloaded the first time, what causes it to be reloaded?
Known Participant
April 6, 2008
I work for the Calgary Real Estate Board in Canada; I run their MLS and Help Desk for our 5700 members. I dabble in Flash when I get the time.

My board wants me to make a training DVD ROM about one of our software solutions for our REALTORS. So it is a training DVD not a webpage and when finished will have 50 or so training movie clips that are linked to flv files. So a Flash Projector file should be perfect.

First of all I have six main swfs. Master, Intro, Settings, Homepage, Clients and Search. So I have a main one with five separate swfs (category pages)

I used to use scenes but was told they are the old way and take up too many resources.

So I have a master swf with 5 buttons and two containers. One container is the whole stage while the other is a takes up only 60% roughly of the stage with room for buttons etc. At this point I do not use levels.

The five buttons load five other swfs that fill the whole stage like the old scenes did. On each of those are 5 - 10 other butttons that play movie clips in the smaller container in that swf.

Hence the five or six separate swfs with different topics attached.

So on the other five full stage swfs, there is a "back to main button" that goes back to the master swf. From ther the user can choose another topic.

Your solution worked for the first go around. I clicked on the search button and was taken to the search swf. Clicking on the various topics (buttons) opened more movie clips in the smaller container Everything worked fine, with no seeing the png file from the master swf.

However, after going back to the master swf and then forward again to the search swf; the original png from the master swf is still showing underneath when loading. It also shows while the new movieclip is playing. It shows a crack under where the video movie clip (flv) attaches to the flash player skin that you get to choose. Again my code on the button(s) is as follows:

on (release) {
myMCL.unloadClip(_root.empty1);
myMCL.loadClip("nusearch6.swf","empty");
}


The first go around as I said earlier got rid of the png and the png file did not show through the crack either. All was great. Yahoo.

I do not know if "_root.empty1" is correct or if some parent code should be used. I am stuck and would greatly appreciate your input please.

Forrest
kglad
Community Expert
Community Expert
April 6, 2008
what do you mean by "...when I go back to my master swf and then go to another swf."?