Skip to main content
Known Participant
June 4, 2011
Question

How to place a movieclip on top of external swf

  • June 4, 2011
  • 4 replies
  • 711 views

Hi there.

I have a main.swf in which i load a xml flash slideshow (.swf).

I want to place a menu which will be shown in front of the slideshow gallery.
I place the menu at an upper layer but the menu appears behind the slideshow.

Can anyone help with this and generally(i.e. in case i want to place something else on top or behind something else)

Thanks in advance

This topic has been closed for replies.

4 replies

Known Participant
June 6, 2011

And if you want to change depth not with a movieclip(like the menu) but with another swf which loads by the same way as the first ?

I create to the next frame a new container to load my new swf . The new container is called myGalleryContainerhtmltext and i want to swap depths between this swf and the previous swf i loaded at myGalleryContainer. I tried this:

myGalleryContainer.swapDepths(myGalleryContainerhtmltext);

but nothing happens

Any ideaS?

My mistake:

i used

this.createEmptyMovieClip("myGalleryContainerhtmltext",1);

and i replaced it with this:

this.createEmptyMovieClip("myGalleryContainerhtmltext",2);

and its wokring fine!

Message was edited by: pantelis224466

Known Participant
June 5, 2011

I load the swf file with this code:

var loader:MovieClipLoader = new MovieClipLoader();
this.createEmptyMovieClip("myGalleryContainer",1);
myGalleryContainer._lockroot=true;
loader.loadClip("Myslideshow.swf",myGalleryContainer);

and i use this code at a layer below the menu layer but still the slideshow appears in front of the menu,

I searched for the swapDepths() function but i read that i can use it with a trigger effect (like on(release) or on(rollover) )

Which is the right syntax of this function to operate correctly without pushing a button or something else

Is there a way that i can see the depths of the movie clips at my .fla and change the depths as i like?

Ned Murphy
Legend
June 5, 2011

If you were to replace that dynamically created empty movieclip with a manually created one placed in the timeline that would take care of the first suggestion I offered.

As for the the swapDepths usage and what you showed, you should be able to use something to the effect of... myGalleryContainer.swapDepths(myMenu);

If you want to see what depth am object resides at, you can use the getDepth() metod, as in... myMenu.getDepth();

Known Participant
June 5, 2011

Thank you it really worked!

Ned Murphy
Legend
June 4, 2011

One way would be to load the external swf into an empty movieclip that you manually place on a layer below the menu layer.  When you dynamically load content, it doesn't have a home in the timeline unless you anchor it into something that does.

Another more generalized approach would be to switch the depths of different objects using the swapDepths() method

kglad
Community Expert
Community Expert
June 4, 2011

use swapDepths() to move your menu above the loaded swf.