Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Movie Clip Depth Problem



I want to set the moviclip depth so that part of a loaded movie is covered by a moviclip I have tried using the swap depth command but seem to be messing up somewhere.

The loaded movie is loaded into level1 and i am trying to set the moviclip to a higher level than this..


Thanks in anticipation



FlashKit > Flash Help > Flash ActionScript
Posted on: 09-06-2001, 09:56 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Movie Clip Depth?
Does anyone know how I can find the depth of a movie clip, how many movie clips deep it is?

I can get the level and I suppose i could split it into an array by the ".", but it seems overkill.

Any one got a better idea?

Depth Of A Movie Clip
I want to set the depth of a movie clip but not by using vreateemptymoviecip.

I have a graphic that i want to sit higher than a graph drawn with lineto and moveto.

Is there an action i can give the graphic (movie clip in the time line that will give it a depth (z index) above the graph lines?

Thanks

Movie Clip Depth
how do i move my movieclip called "_root.hello" to the top depth? i want to add this onto a button so it appears in the front of everything.

Does anyone know the simple code for this?

Movie Clip & Depth(s)
Hi everyone,

heres what i want to do...

i have a library of 'item' movieClips that gets loaded into the same spot on _root. However as it loads, it replaces over the previous item by transitioning
over it....

heres how i've done it.... (psuedo code'ish)

ActionScript Code:
var item = (any object from library)
root.attachMC(item, newItem, 2)     //note depth is 2

//item uses the same 'item.as' class file....so that when it is attached, 'onEnterFrame()'
executes code so that it transitions over whatever item there was on _root before.
after transition... the item object sets its own depth to 1....
so that the next item loaded, is attached over it (depth 2)

my dilema is the depth conflicts... when the 2nd clip loaded wants to go to depth 1.

I think my way around this is to remove the previous item in depth 1....

but how do I do that?.....

Movie Clip Depth
I have a movie clip with a button. On release of the button another movie clip is attached on top of the clip that attached it. I need to keep the first clip on top of the second. Any suggestions? Thanks, Mike

Movie Clip Depth On Top
I am trying to come up with a simple way to disable other m.c.'s that are on the stage while some dynamic data is being loaded.
Someone suggested that I place a movie clip over the top of all of the other m.c's however you can still press the clips that are underneath the overlayed mc.
Is there a simple way to globally enable and disable all m.c.onRelease functions?

thanks J.

Movie Clip Depth
I know this topic has been beaten to death in these forums but I had a quick question I was hoping someone could answer. I made a calendar that populates using duplicate movie clip. I have an additional mc to display event data that plays when the user clicks on one of the calendar dates.

I need the second mc to always be on top. By default, it has a depth of approx. -16000. To put it on top I used.

onClipEvent(load){
this.swapDepths(this._y)
}

This works fine for the first displayed month, but when I go to another month or year, this clip defaults back to it's original depth of -16000.

When I go to a new month or new year, my AS increments the year or month value then re-runs the duplicate mc function to populate the calendar.

the swapdepths takes place on the first frame while the duplicate mc function is occuring on the third frame. When the buttons to change the year/month are pressed, frame 3 is re-played.

I was able to get around this using attachMovie, but my question is, why does the depth default back to -16000 if movie runs only frame 1 only one time and never again? Should the depth stay at the new depth?

This is by no means an urgent issue, as I said I got around it with attach movie, it's just more to satisfy my own curiosity.

Thanks.

Movie Clip Depth Help
I have a number of dynamically created movie clips that are on top of any other MC that comes in later in the movie how do I make the new MC play on the top of the dynamically created clips.
Thanks

Movie Clip Depth
I know this topic has been beaten to death in these forums but I had a quick question I was hoping someone could answer. I made a calendar that populates using duplicate movie clip. I have an additional mc to display event data that plays when the user clicks on one of the calendar dates.

I need the second mc to always be on top. By default, it has a depth of approx. -16000. To put it on top I used.

onClipEvent(load){
this.swapDepths(this._y)
}

This works fine for the first displayed month, but when I go to another month or year, this clip defaults back to it's original depth of -16000.

When I go to a new month or new year, my AS increments the year or month value then re-runs the duplicate mc function to populate the calendar.

the swapdepths takes place on the first frame while the duplicate mc function is occuring on the third frame. When the buttons to change the year/month are pressed, frame 3 is re-played.

I was able to get around this using attachMovie, but my question is, why does the depth default back to -16000 if movie runs only frame 1 only one time and never again? Should the depth stay at the new depth?

This is by no means an urgent issue, as I said I got around it with attach movie, it's just more to satisfy my own curiosity.

Thanks.

Depth Of Movie Clip
Ok! my problem is as follows.
I have a movie in which i am loading other movie named "mymovie"
I am loading it on level 1.
I have some elements in the main movie which go under the loaded clip.
I need them overlapping the loaded movie.
I don't want to load the movie in a tergeted movie clip. I need it on level 1 as it is.
How do i make the existing elements come over the loaded movie.
I know it has to do something with levels or depth.
PLEASE HELP!

Movie Clip Depth Disaster
Hi to all flash masters!

I spent couple of nights solving this problem.
Im working on some game.
I have couple of movie clips on stage. One of them is duplicated after button is pressed. Every new duplicated movie clip has depth=depth+1.
ok?

So , all duplicated movie clips have to be under the others, non duplicated ones.

I've been trying to set up depth for non duplicated movieclips big enough to be everytime over other the nonduplicated ones.I can't find out, how to set up depth of movie clip , which is not duplicated on start.

When I tried to use swapDepth function, the original movieclip was (for some reason) duplicated.
Any Idea will be very appreciated.
Leos

Setting The Depth Of A Movie Clip?
Hello,

I need to set the depth of MovieClip: BackBox

The reason is so it will be on top of everything else in the time line, even Duplicated MovieClips.

Please help me with code.

THanks

Depth Of A Movie Clip After Duplicating?
hello,

I have MovieA which is Duplicated about 37 times with the below code:

---------
duplicateMovieClip (this.CalendarX, "mc"+start, start);
setProperty ("mc"+start, _x, newx);

That works fine, but i have a button inside of the movie, which displays info when a user rollover it. I need the code to to movie the the movie which the mouse is over to be on top of the other 36. I have tired the below with no luck. Please help Thanks!!!

onClipEvent(load){
this.swapDepths(50);
}

Can You Change The Depth Of A Movie Clip?
Hi,

I've read loads of stuff about how to change the depth of a duplicated movie clip but here's my problem: I've got a load of different objects in a room that you have to rearrange by dragging and rotating. I use startDrag to pick up the object then, if your mouse is still pressed, you can rotate the object. This works fine for the object on the top but if you drag any other objects underneath the one on top of them the release/rollOut is ignored. Is there any way that when you click on the MC it will bring it above the others?

Thanks

Depth Problem ...[Movie Clip]
Hello all,
and many to websam ...


Now as fool programmer as I am, always mingled in troubles, here is a new one ...



I am running a movie which has 11 buttons, and each attaches a different movieclip with it ... like, whenever a single button is clicked a movieclip is fired and so it goes.. I had a problem in depth, like everything mingled up previousely, but my scripter hero WEBSAM helped me and send me the following code. . .


Code:


function initialize(){
arrayMC=["Introduction_Play","Mission_Playi","Objectives_Play","Temptation_Play"];
i=0;
mcNum = getNextHighestDepth();
}

play.onRelease = function(){
initialize();
loadMC();
}

function loadMC() {
_root.attachMovie(arrayMC[i],arrayMC[i],mcNum++);
if (i>0){
_root[arrayMC[i-1]].unloadMovie(); // remove first MC
}else if (i==0){
_root[arrayMC[i+arrayMC.length]].unloadMovie(); // remove last MC
}
if (i++ > arrayMC.length){ // reset i = 0 when reaching end
i=0;
}
}

btn1.onRelease=function(){ //Introduction_Play button
_root[arrayMC[i]].unloadMovie(); // remove current MC
i=1;
loadMC();
}

btn2.onRelease=function(){ //Mission_Playi button
_root[arrayMC[i]].unloadMovie(); // remove current MC
i=2;
loadMC();
}

...... so forth for the other buttons

stop();





function loadMC() {
_root.attachMovie(arrayMC[i],arrayMC[i],mcNum++);
if (i++ > arrayMC.length){ // reset i = 0 when reaching end
i=0;
}
}

It's a perfect code, but only if movie starts from the Play button, and afterwards others, but my movie can start from any button, like user can press any button to start off ...
ALAS .. that left me helpless ..............................
I also coded to mingle with this problem, but as usual all junk, it ran somewhat correctly, but you never know that when it creashes and halts ....


Here is the code ....

CAUTION
=======
Please curse me less after seeing it ............


Code:


iMenus.Introduction.onRelease = function(){

if (_root.iBack!=null)
{

//unloadMovie(pic420);
//unloadMovie(_root.pic420);
//unloadMovie(_root.pics0);
}



if (iMainHome)
{
iBack="Introduction";
_root.attachMovie("Introduction_Play","pic420",nextDepth-2);
pic420._x=0;
pic420._y=0;//185.4


}
else
{
iMainHome=true;
iBack="Introduction";
_root.attachMovie("Fade_Home","pics0",nextDepth-2);
i=nextDepth-2;
pics0._x=358.3;
pics0._y=342.8;
}


};
iMenus.mission.onRelease = function(){


if (_root.iBack=="Objective")
{

//unloadMovie(picOBJ);
}
else if (_root.iBack=="Introduction")
{

unloadMovie(pic420);
}

a=iMainHome add iBack;
/******************************************/
iBack="Mission";
if (iMainHome)
{

_root.attachMovie("Mission_Playi","picMIS",nextDepth-2);
picMIS._x=0;
picMIS._y=0;


//_root.pic420.clear();

}
else
{
iMain=true;
iBack="Mission";
_root.attachMovie("Fade_Home","pics0",nextDepth-2);
i=nextDepth-2;
pics0._x=358.3;
pics0._y=342.8;
}


};


iMenus.objective.onRelease = function(){


if (_root.iBack=="Introduction")
{


unloadMovie(pic420);

//unloadMovie(_root.pic420);
//unloadMovie(_root.pics0);
}

a=iMainHome add iBack;
/******************************************/
iBack="Objective";
if (iMainHome)
{

_root.attachMovie("Objectives_Play","picOBJ",nextDepth-2);
picOBJ._x=0;
picOBJ._y=0;


//_root.pic420.clear();

}
else
{
iMain=true;
iBack="Objective";
_root.attachMovie("Fade_Home","pics0",nextDepth-2);
i=nextDepth-2;
pics0._x=358.3;
pics0._y=342.8;
}


};

Fade_Home is a generic movie clip which runs just after the main movie clip , like i tried to should the consistency .... in all of the movie clips .......



Phew ....
i just want that when ever i press any button, it just show me the required movieclip, no matter in which direction and no matter which button ............



P.S.
Please, if possible, try to help me in this [mine junky munky] code,
if possible .....


Thanking you in advance .......
Faisal

Assigning Depth To Movie Clip...
I have a simple looping .fla which runs through a 3 frame loop, and each time through the loop duplicates a movie clip via:

_root.tile.duplicateMovieClip("tile"+i,i+1)

The actions are added into keyframes on the main timeline. That works fine.

But, whenever I add anything else to the stage, be it some text in another layer (even if put in above the a/s for the looping), the duplicated m/cs generated via the loop always appear above any other content.

I know that this is to do with the depth of the instances of the m/cs.

Please can someone advise as to how to add any new content onto the stage, and for that to appear on top of the duplicating m/cs. I have tried working out how to assign a depth level to the new content, but cannot work it out.

Thanks

Jim

Movie Clip Depth In Timeline
Howdy guys.

I've got this bit of code that attaches a movie clip to something, but I want it to appear under some transparent graphic symbols, but it appears over them.

What's the plan? Do I have to convert all the graphics to movies and do swap depths on everything? Can you have transparent movie clips?

Thanks.

How Do I Dynamicly Set Movie Clip Depth?
Hi, I am making a 3d engine using formulas from a different language and its coming along nicely but I am having depth issues. How do I set the depth of an object within the script? I need the depth to change so I objects that are farther in the distance are further behind other objects.

Movie Clip Depth Issues...
I have 8 movie clips that are in a row that have instance names. When you rollover them they enlarge and overlap each other. Problem is I always want the rollover one to be in front of all the others. Arranging the layers will do nothing but just put that one clip on top of the other. I am very unaware of how these need to be set up on an actionscript end of things. Can someone help??? I am very newbie to the AS here...

Changing Depth Of A Movie Clip
Hi Everyone,

I'm trying to get something done here. I've got a bunch of movie clips that are in my cast. Later on after the movie has been running I would like to change depth of these movie clips. Is there anyway I can change them using an integer?

What I'm looking for would be something like movieclip.setDepth(newDepth) but I know that the setDepth method doesn't exist (or if it does I can find no documentation on it that's for sure).

Any thoughts or ideas would be greatly appreciated. Thanks.

slan,
Pat

Question About Movie Clip Depth
how can i control the depth on movie clips created in actionscript

Movie Clip Depth Problems
Hi everyone. I have a bit of a depth problem. My program has several buttons which, when rolled over, expand and make the button bigger in the middle of the screen. The problem that I'm having is that I can't seem to make the rolled over movie clip at a higher depth than the buttons.

I've tried setting "movie-clip.swapDepth(99999);", and even that doesn't seem to work. Is it possible that some of the other buttons are at an even higher depth? I have tried using getDepth, but nothing seems to show up in the output window.

I have searched these forums extensively, but to no avail. I'm quite inexperienced with action script and flash in general.

Depth With Attach Movie Clip
im having problems with attach movie clip. Ill attach a movie clip to a second movie clip.



PHP Code:



attachMovie ("imageA","imgA",1)
_root.imgA.attachMovie ("imageB","imgB",0) 




for some reason imgB well appear above imgA and ive tried a few things like even swapping depths after ive made them. I would like to have imgA above imgB. Please and Thank You.

Movie Clip's Depth Question
I am creating a simple 7 questions flash game.
Upon answering and hit the submit button, there will be 7 different response mc displayed onto the stage.
How do I show all these 7 response mc onto the stage at the same time?
Do i use MovieClip.getDepth() or MovieClip.getInstanceAtDepth()? How do i actually use these function?

Set The Depth Of A Movie Clip Instance
Hi,

is there a way to set the depth of a movie clip instance that is on the stage, ie. not created via createEmptyMovieClip, attachMovie, duplicateMovieClip and so on? Something like

my_mc._depth = 3

thanks in advance!

Duplicate Movie Clip Depth
Mushi mushi.

I'm using this code


onClipEvent(enterFrame){
i++;
duplicateMovieClip(_root.star,"star"+i,i);
_root.counter=i;
}

and what I think that's doing is placing each new clip it creates on a new level above the one before it. It's caused a problem as I have other stuff in my movie that I need to stay above these movie clips, and at the moment it's getting bumped to the bottom.

Anyone have any ideas as to how I can keep these generated movieclips below my content, or maybe go the other way and push my content above the movie clips?

Thanks in advance.

<"))))><

Swap Depth With Another Movie Clip?
hello all,
i have 2 clips on my stage.
how can a swap the depths between the two of them?

in addition, how can i set the depth of a MovieClip?

Thanks for any help.

i used to do this:

clip1.swapDepths(clip2)

but AS3 has changed things, and i cant find the equivalent.

Assigning Depth To Movie Clip...
I have a simple looping .fla which runs through a 3 frame loop, and each time through the loop duplicates a movie clip via:

_root.tile.duplicateMovieClip("tile"+i,i+1)

The actions are added into keyframes on the main timeline. That works fine.

But, whenever I add anything else to the stage, be it some text in another layer (even if put in above the a/s for the looping), the duplicated m/cs generated via the loop always appear above any other content.

I know that this is to do with the depth of the instances of the m/cs.

Please can someone advise as to how to add any new content onto the stage, and for that to appear on top of the duplicating m/cs. I have tried working out how to assign a depth level to the new content, but cannot work it out.

I have made the content I want to appear on top into a movie clip, called the instance of this "bbb", and then added this into the timeline AS below the DuplicateMC line shown above:

bbb.swapDepths("tile"+i);

but that doesn't help either!

Thanks

Jim

Duplicate Movie Clip Depth Below Timeline?
Is it possible to duplicate a movie clip and have it sit below the other objects on the timeline?

When i set the depth to -1 or below The clip disapears after 1 frame. Anything above 0 and it is above all the objects on the timeline.

I am trying to create terrain scrolling for a game (a road) with lots of cars on the road. -

I thought i could duplicate movie clips and arrange them to make of the background of the road. These would then be removed when they have been scrolled off the edge of the screen and new clips would be duplicated at the top.
Do you know if it would be just as easy to use the attach clip function?

If Mc's Depth Is Greater Than 50, Remove Movie Clip?
how can i say "if any movie clip that is attached to root's depth is greater than 50, remove the movie clip?"

OnRollOver Not Obeying Movie Clip Depth
Hello. I have a movie clip which has an onRollover action applied to it (when rolled over, something happens). I have created another movie clip which hides half of the one with the onRollover action. My problem is that the onRollover action is still being executed, even when the mouse rolls over the half of the movie clip that is being hidden

I have set the depth of the two movie clips correctly. The movie clip that hides half of my other movie clip is at a higher depth. To be sure it wasn't me, I even tried switching their depths, but the same problem occurs.

If anyone has any ideas I would greatly appreciate it.

Thanks!

Setting A New Depth Of An Existing Movie Clip
Is there anyway of setting the depth level of a movie clip without duplicating it or swapping it with another clip?

Changing The Depth Of A Nested Movie Clip
Does AS2 offer a way to change the depth of a nested movie clip? I'm working on a project where I need to move a clip (however deep it is nested within other clips placed manually on the stage) to the very top of the movie. I've only had luck bringing the clip's outermost parent to the top using DepthManager.

Thanks in advance.

Quick Movie Clip Depth Question
I have a website I am creating that loads a dynamic photo gallery using AS of course... On the site there a movieclip that show a transition everytime you click from section to section of the site. What would I use as far as actionscript on this movie clip to ensure that this transition efx is ALWAYS on top of EVERYTHING (that way this transition effect always appears over the gallery....ect).

Thanks to anyone taking time to check this question out.

Swap Depth The Movie Clip In Flash
Hi,

Queries
------------
The problem that I am facing now is I cannot close the small thumbnail window using the close button in the top of the small thumbnail window. Could u pls give explain me how to close the small thumbnail window. and also how the alpha transparency of the large image window can be set i.e when i am clicking the large image window 1 that should appear brighter and the remaining imagae windows 2,3,4 should appear dull and also I am having another doubt if I open the large image from the first gallery and the second large image from the second gallery is that any possibilities there to swap depth that two movie clip. Expecting your earliest reply.

To view the source file pls check this url

http://216.69.167.77/flashquries/

Warm Regards,
Rajesh

OnRollOver Not Obeying Movie Clip Depth
Hello. I have a movie clip which has an onRollover action applied to it (when rolled over, something happens). I have created another movie clip which hides half of the one with the onRollover action. My problem is that the onRollover action is still being executed, even when the mouse rolls over the half of the movie clip that is being hidden

I have set the depth of the two movie clips correctly. The movie clip that hides half of my other movie clip is at a higher depth. To be sure it wasn't me, I even tried switching their depths, but the same problem occurs.

If anyone has any ideas I would greatly appreciate it.

Thanks!

HELP: Invisible Ink (Movie Clip Depth Problem)
I'm having trouble getting an emptymovieclip which i have created to draw with to appear below the top layer. . . is LineTo always at the top depth????


my bad

Finding The Depth Of Clicked Movie Clip
Hi All
I need help to find depth of one of the movie clips on the stage.

Movie clip exists in flash library and its associated with a class using linkage properties.Its instantiated as below

Code:
var atomSmall1:AtomSmall=new AtomSmall();
Mulitple duplicates are created on the screen. I need to find the depth of the movie clip when I click on it. Code given below is the handler for the movie clip.
Below is the code snippet I have used.

Code:
private function removeAtoms1(evt:Event):void {
var targetName:String=String(evt.target.name);
trace("Target Name is "+evt.target.name); ///instance120 or keeps changing
var target1:DisplayObject = getChildByName(targetName);
trace(target1) ////Prints NULL
trace("Depth of the atom "+ getChildIndex(target1));
}
Below is the output of trace and error message


Code:
Target Name is instance208
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/getChildIndex()
at ChemistryActivity1View/::removeAtoms1()

Action Script: Movie Clip Depth Question?
I am a little confused by the whole depth levels for movie clips. I understand that you can set it if you use attachMovie() but what if i want to set the depth for a movie clip i created on the stage?

any info you guys can give me would be a huge help.

Change The Depth A Movie Clip Is Drawn (so It Shows Behind Something Else)
Hi all,
I have a problem and that is i am drawing a MovieClip to screen through as3 and i have previously put a MovieClip down with in the main time like (not in the code).

as my MovieClip through as3 is put down last it obviously appears on top. However i need to send it back so it appears under the other MovieClip.

is there code that will allow me to do this so i can say do like a MC.depth = -1; and it will send it back. does this sort of thing exist?
Regards
Mark

Dynamically Created Movie Clip Depth Issue
I am creating empty movie clips with a for loop, which then have a jpeg loaded into them. In relation to _root, these clips are being created in "_root.frame.scroller". Scroller is a movie clip on the stage, but with nothing in it, except the script.

The result on the stage is a movie clip in a movie clip in a movie clip (i.e. _root.frame.scroller.DYNAMICALLY GENERATED MC.)

The issue is that the event handling (onRollOver) isn't working. No action, no hand cursor, no nothing -- like it's not even there. So I think it's a depth issue, but I'm stuck.

Here's the code, which exists at frame1 of the MC "scroller'.

ActionScript Code:
totalimages = 5;
for (i=0; i<=totalimages; i++) {
    img = "img"+i;
    this.createEmptyMovieClip(img, i);
    this[img].loadMovie("pic_"+i+".jpg");
    this[img]._xscale = 18;
    this[img]._yscale = 18;
    this[img]._x = -82;
    this[img]._y = (i*120)-290;
    this[img]._alpha = 75;
   
    this[img].onRollOver = function () {
        this._alpha = 20;
    }
}

I recognize it may be easier if you could see the FLA, but I cannot provide it. Sorry about that.

Thanks in advance.

Set Alpha Transparency For The Swap Depth Movie Clip
Hi friend,

I need to set the alpha transparency for the swap depth movie clip. I am hereby sending you the queries in jpg files format . Please help me out. Expecting your earliest reply.

Regards

Rajesh

Getting Dynamic Random Movie Clip To Swap Depth I Think?
Hi all on the forums. I hope you guys can help.
This is what I have done. experimenting thus far.

I loaded some data form an XML file into flash.
Then looped through the XML nodes and attached a movie clip to each of the nodes and data.
and to finish it off i added random movement to the movie clips.. they keep moving to new X and Y coordinates.

However if a movie clip in the lower part of the stage is moving up to the top portion of the stage it does not appear in front of the movie clip as it advances upwards.. and vice versa.. sometimes..

I am not sure if this happens because of the line of code that attaches the movie clip automatically attaches the clip to the next depth. The line is as follows.

Code:
var t = attachMovie("image","image"+i, i);
I am stumped.. what i would like to happen is as they advance towards each other those with the greater Y value (nearer the bottom of the stage) appear as it they should which is appear closer. I think that is the correct term I am using...

So any suggestions is appreciated.. Thanks for the help...

Move Movie Clip To A Higher Depth/in Front Position
Does anyone know how to move a movie to a higher depth or "in front" of another movie clip?

I used the duplicatemovieclip and specified a higher number for the depth, however it seems as if a waste to duplicate a clip and have two copies rather than just move it to a higher stage. Thanks in advance...

     Aaron

[as1] [clip Depth] Can You Assign A Clips Depth?
Does anyone know if it is possible to assign a depth to a MC? What I need to be able to do is to tell a MC to be at a certain depth. Any thoughts?

--xenite

Duplicate Clip V Stage Clip Depth
Finding no way to make a pleasant sine curve move across the screen, I created one curve via actionscript and duplicated it a few times and used the script to move off-screen clips back to their original position to play again througout the movie... The move via a Enterframe function that runs in an actions layer throughout the length of the movie.
PROBLEM - My script-made clips are showing on TOP of every stage-based movie clip I have. I've tried adjusting the depth of the duplicate script-clips but its not helping. Is there any way to make sure the script-clips are behind all the stage-clips throughout the movie???

Internal Clip Depth
hi,
how do i set the depth of an internal movie clip? .i'm loading other clips externaly and need this built in clip to always be on top...is swapdepths the only way?

Forcing Depth/level Of Clip On Stage
Can I set the depth of a movieclip I've placed on the stage?

I've duplicated 12 movie clips and given them a depth of 0-11.

I've got another movieclip on the stage which I want to sit on top of them, but at the moment it's behind them. It's in the top layer (which I know is just an Flash editing thing). How can I force my movieclip on the stage to be in the top level, even when I dynamically add other clips to the stage later? There must be a way to just give it a depth of 20 or something?

Thanks for any pointers! I've checked out previous posts here and read the ActionScript Dictionary relating to this and can't find anything useful!

Sean

Depth Problems With Mask In Embedded Clip
Hi all, I have a Holder Movie, that holds three movies

a) a top section
b) mid section
c) bottom section

The main clip loads them to depths like this:

PHP Code:



//load clips
_root.createEmptyMovieClip("navHolder",-16381);
_root.navHolder._x = 0;
_root.navHolder._y = 0;
_root.navHolder.loadMovie(_global.absURL + "GSTopNav1.swf");

_root.createEmptyMovieClip("midHolder",-16382);
_root.midHolder._x = 0;
_root.midHolder._y = 72;
_root.midHolder.loadMovie(_global.absURL + "GSBottom1.swf");

_root.createEmptyMovieClip("bottomHolder",-16383);
_root.bottomHolder._x = 0;
_root.bottomHolder._y = 313;
_root.bottomHolder.loadMovie(_global.absURL + "GSBottom1.swf"); 




You can see the files are loaded to levels -16381 to -16383 to make each item go over the lower one.

Now in the bottom file i have a mask that i created from a sample found on flashMove Forum (the katie holmes sample ) It works fine when i play the bottom .swf file by itself but does not show up when i play it in the wrapper movie. Its something to do with depths but i've tried hundreds of different levels for both the masks and the holder and hoped someone could lend me some advice:

Below is the code to create the masks:

PHP Code:



//set up mask
var columns = 20;
var rows = 12;
var timeSpan = 50;

// don't mess with this
var depth = 0;

// MovieClip PH;
// create placeholder clip to put mask squares
//I changed this depth level from 0 to all kinds of #'s 
//either just the home image showed up or nothing at all. 
var PH = _root.createEmptyMovieClip("PH_mc", 0);
// for loop that creates the mask
for (var i = 0; i < columns; i++) {
    for (var j = 0; j < rows; j++) {
        var mask = PH.attachMovie("blk_oval_mc", "mask_" + i + "_" + j, depth++);
        var stagger_row = j % 2 == 0 ? 67.8 / 2 : 0;
        //var stagger_row = j % 2 == 0 ? mask._width / 2 : 0;
        mask._x = i * 67.8 + stagger_row;
        //mask._x = i * mask._width + stagger_row;
        mask._y = j * mask._height / 2;
        mask._y = j * 45.0 / 2;
        var interval = j * timeSpan;
        trace("MASK DEPTH" + PH.getDepth());
        mask.delayID = setInterval(delay, interval, mask);
    }
}

// function for the setInterval
function delay(mc) {
    mc.play();
    clearInterval(mc.delayID);
}

// set alpha
home_image_mc._alpha = 100;

// set mask
home_image_mc.setMask(PH); 




you can see where the depth gets changed:
var PH = _root.createEmptyMovieClip("PH_mc", 0);
I tried making the other levels depths higher than the PH_mc's depth but it does not ever show the mask!

Any help appreciated.
mcm

Copyright © 2005-08 www.BigResource.com, All rights reserved