Clearing object or layer after loading external swf?

  • blkryder
  • Born
  • Born
  • blkryder
  • Posts: 4

Post 3+ Months Ago

I have a flash site that I am setting up that loads a main navigation page and then loads galleries from seperate swf files into a top layer that has a transparent symbol that holds the clip.

I am using the following command to place the swf files into the object

PHP Code: [ Select ]
on(release){
 
loadMovie("kumi.swf",dump);
 
}
  1. on(release){
  2.  
  3. loadMovie("kumi.swf",dump);
  4.  
  5. }


My question is the gallery has a home button that I want to clear the object dump or set it back to its original empty/transparent state so that I can see the main navigation page and choose other galleries.

How would one go about scripting the home button to clear the swf file out of the object or layer so that I can see the main page under it.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

if you name the container clip, you can use this:
PHP Code: [ Select ]
on(release){
 
containerClip.unLoadMovie("kumi.swf", dump);
 
}
  1. on(release){
  2.  
  3. containerClip.unLoadMovie("kumi.swf", dump);
  4.  
  5. }

although i'm not exactly sure what the word dump is for.

same thing would apply to loading the movie:
PHP Code: [ Select ]
on(release){
 
containerClip.loadMovie("kumi.swf", dump);
 
}
  1. on(release){
  2.  
  3. containerClip.loadMovie("kumi.swf", dump);
  4.  
  5. }
  • blkryder
  • Born
  • Born
  • blkryder
  • Posts: 4

Post 3+ Months Ago

Forgive my ignorance but I am new to this.

What I did was make a layer and put a rectangle that was transparent on that layer and convert it to a symbol which has movie clip set as the property and it's named dump so the command

on(release){
loadMovie("kumi.swf",dump);
}

is placing the swf file into that symbol.

You mention using a container clip. How do you set that up?
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

no need to aplogize! we all started somewhere, and they are all great
questions. :D What you did then, is what I described == using a
container clip. It's pretty much what I said, but let me clarify.

You need to do is make sure you have the instance named dump. Click
on the instance on the stage, and in the properties panel, type in dump
into the Instance Name field.

then apply this code to the button you want to clear it with:
PHP Code: [ Select ]
on(release){
 
dump.unLoadMovie("kumi.swf");
 
}
  1. on(release){
  2.  
  3. dump.unLoadMovie("kumi.swf");
  4.  
  5. }
  • blkryder
  • Born
  • Born
  • blkryder
  • Posts: 4

Post 3+ Months Ago

So, when I turned the object into a symbol I named it dump and the command

on(release){
loadMovie("kumi.swf",dump);
}

seems to load the movie fine.

As you suggested I selected the object and gave it an instance name in it's parameters, say place , so when I look at the object in the actions menu it is named dump, <place>

so when I then tried your command

on(release){
place.loadMovie("kumi.swf");
}

it does nothing and the command

on(release){
place.unLoadMovie("kumi.swf");
}

isn't working to unload the movie placed with my earlier command as well

on(release){
loadMovie("kumi.swf",dump);
}


What am I missing?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

:scratchhead: Why not just give everything an instanceName and place somthing like this in the main timeline ?
PHP Code: [ Select ]
 
loaderButtonInstanceName.onPress = function(){
 
   containerInstanceName.loadMovie("movieName.swf");
 
}
 
unLoaderButtonInstanceName.onPress = function(){
 
   containerInstanceName.unLoadMovie();
 
}
 
 
  1.  
  2. loaderButtonInstanceName.onPress = function(){
  3.  
  4.    containerInstanceName.loadMovie("movieName.swf");
  5.  
  6. }
  7.  
  8. unLoaderButtonInstanceName.onPress = function(){
  9.  
  10.    containerInstanceName.unLoadMovie();
  11.  
  12. }
  13.  
  14.  


Just make sure you get all the paths correct :)
  • blkryder
  • Born
  • Born
  • blkryder
  • Posts: 4

Post 3+ Months Ago

So the only thing I can get to work so far is to load the movie with

on(release){
loadMovie("gallery.swf",dump);
}

Which loads the swf file into the transparent symbol "dump"

That works fine...

Now to unload the movie the only thing that seems to work is

on (press) {
this.unloadMovie();
}

Which is activated from a button inside the loaded movie. The new problem I am having is when I unload the movie I am left with a blank screen not with the layers of the original layout visible so that I can load another swf from my main page.

So, my question is when you unload a movie how do you return the layer to its previous state, which was a transparent shape node with my main page visible on lower layers? I can't tell what is happening exactly but the screen just goes white after I unload the movie. It doesn't releal the buttons and layout of my main page that were under the shape that the movie was loaded into.
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

truthfully this is impossible to help you without the source code in front
of me. So all in all, your work around is still a good way to go about it
because then you are brining usability into the picture by allowing more
than 1 option to navigate your site.

as for clearing the containerClip, try putting the movie name in the unLoadMovie using:
PHP Code: [ Select ]
on (press) {
 
this.unloadMovie("gallery.swf");
 
}
  1. on (press) {
  2.  
  3. this.unloadMovie("gallery.swf");
  4.  
  5. }

what is funny about all this, is both joebert and I have given you 2
different ways to do this, and now you came up with a 3rd. This is the
beauty of flash, and the aggravating part all in the same light. ;)
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Is the button in the loaded movie nested inside anything ?
try,
Code: [ Select ]
on (press) {
_parent.unloadMovie();
}
  1. on (press) {
  2. _parent.unloadMovie();
  3. }

Code: [ Select ]
on(press){
_parent.dump.unloadMovie();
}
  1. on(press){
  2. _parent.dump.unloadMovie();
  3. }

Or even,
Code: [ Select ]
on(press){
_root.dump.unloadMovie();
}
  1. on(press){
  2. _root.dump.unloadMovie();
  3. }


Like Unflux, I too am having trouble picturing exactly whats going on.

I like to use somthing like this for multi-movie movies,
Code: [ Select ]
_root.createEmptyMovieClip("instanceName", _level);
   with(instanceName){
     _x = 10;
     _y = 10;
   }
  1. _root.createEmptyMovieClip("instanceName", _level);
  2.    with(instanceName){
  3.      _x = 10;
  4.      _y = 10;
  5.    }
  • monsieur_le_christophe
  • Student
  • Student
  • monsieur_le_christophe
  • Posts: 71
  • Loc: Wales, UK

Post 3+ Months Ago

Thanks guys, had same problem but tis resolved due to above posts!

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: No registered users and 17 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.