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




Depths



Hey, I'm tyring to duplicate multipul movie clips (rockets for my spaceship game), but i want to duplicate them so that the rocket is under the spaceship, i tried duplicating the movieclip then swaping the depth the the spaceship, but then when i go to remove the rocket movie clip, the first rocket that was created doesn't get removed.
I need help with this, i dont know whats wrong



FlashKit > Flash Help > Flash ActionScript
Posted on: 01-27-2002, 03:48 PM


View Complete Forum Thread with Replies

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

Help With Depths
doctor.hothere.com

I have the links leading to tell target a movie clip. The problem is that I have many links, and I don't know how to use the depth to have the movie clip on top of the others when the button that leads to the clip is clicked. Her's the code I have now.

on (rollOut) {
tellTarget ("Member Pic MC-Disappear") {
gotoAndPlay ("Member Disappear");
_root.depth++;
this.swapDepths(_root.depth);
}
}
on (release) {
tellTarget ("Member Link") {
gotoAndPlay ("Member Link");
_root.depth++;
this.swapDepths(_root.depth);
}
}
on (release) {
_root.depth++;
this.swapDepths(_root.depth);
}

Depths
Hi there,

I know how I have to load an external movie on the second level, but what do I have to do to make sure that the movieclip on the original timeline (now level 1) is on level 2 so I can load an external movie underneath?

greetings

robin

Depths
Got a project going where you can open up a few windows at once. I have the depth problem solved, but I also have a "tooltip" mc incorporated and the problem is that when the windows come to the top (only after they come to the top), my tooltips crash to the bottom and are hidden behind the windows! How can I make the tooltips come to the top regardless of all other level depths (like level 100 or whatever)? I tried a few scripts on the tooltip mc but nothing seems to work. Thanks for any advice.

MC Depths
I'm not to sure about this MC depth thing but I think it's causing problems to a game I'm making.

If 2 movieclips, completely different from each other have been created by different movieclip actions but have been given the same depth, does this mean one will over-write the other?

Also can you assign a depth of -1 for example so appears under a movie clip with a depth of 0?

Thankyou for your reply if you do. Great help.

Depths O_0?
ok, i've got a main interface. pages get loaded into it on button release. the pages represent windows like um... microsoft windows. when i'm loading the pages i use a counter variable for the depths they're loaded into. i.e.


Code:
on (release) {
//_root.home1.unloadMovie()
_root.createEmptyMovieClip("home1", counter);
loadMovie("home.swf", "home1");
container._x = 0 ;
container._y = 2 ;
counter = counter + 1;
}
the counter increments evrytime i load up a new page, on the loaded pages i have this code:

Code:
on (press) {
_root.home1.swapDepths(counter + 1);
startDrag(_parent);

}
from what i've read on senoclears tutorial and various posts here that should work, however it doesn't seem to be working.

also, aside from that, after i close (unloadmovie) a window that has been loaded and load another one ontop (incrementing the counter) if i re-open the window that was closed it re-appears on the origional level it was closed on and not the top level as i (and the counter) expected. and1 have any suggestions?

cheers, squid.

How To (depths)
Hi there,
I´m stuck with a problem and don´t know which is the best way to solve it. I don´t need a ready solution, but maybe just a different way to approach it...

Ok, I´ve got 15 dynamically loaded jpeg stacked on top of each other in levels 200 to 215. Now I want to fade them in and out...
The problem is, the image on the higher levels fade much smoother and faster than the images on lower depths. Fading against the background is awfully slow.
Fading becomes much quicker, if I put a mc which contains just a white square big enough to hide the images just below the fading objects.

This is how I´d do it:
Put the white square on level 218. Load the images which have to be faded on levels 219 and 220 with .swapdepths. Keep track which movie is where and create a routine to swap them back to their original level after use.

Doesn´t sound like a good solution, more like a workaround.

Has anyone another idea???

MCs Depths
ok i use _root.createEmptyMovieClip(i, -10000+i); to make all the MCs i need and i use _root[i].loadMovie(k) to put pictures in the MCs... now that's all fine, but everything alse renders below these pictures, like they were in the top layer... but they are from -10000
now why are they ON everything?
if anyone knows, i'd be happy to be helped

MCs Depths
ok i use _root.createEmptyMovieClip(i, -10000+i); to make all the MCs i need and i use _root[i].loadMovie(k) to put pictures in the MCs... now that's all fine, but everything alse renders below these pictures, like they were in the top layer... but they are from -10000
now why are they ON everything?
if anyone knows, i'd be happy to be helped

Depths
Im working a game, and i've come across a problem. I need some stuff(we will call it A) that is inside of a movieclip higher then something (we will call it B) on a differnet layer in the main timeline. I would normally just move that movieclip (A) up a few layers in the timeline, but there are other parts of movieclip A i need to be lower then Movieclip B, if that makes any sence. Is there a script i can use to tell movieclips which depth to be set at that will ignore where they are on the timeline?
Hope that makes sence.

MC Depths
Is there a limit to the amount of MC depths you can use??

I am making a tile based game, and i am attaching the baddies as new MC's on the grid (each on a separate depth). The game works fine until i add more than 6 badies to the screen.

Cheers
Paul

Depths?
hey,

I have four buttons, then i have four movie clips that have a simple picture transition animation. OK, i wanna make it so when someone clicks button 2, then my movieclip 2 plays ONTOP of the current movieclip. and if they click on button 3, then movieclip 3 would play it's trasition animation ONTO of the current moveclip (movieclip 2) and so on. So bascially, i want my new picture animation to load on top of the current (so while the new animation is playing, i still want the current image (moveieclip) to on the bottom.

Does anyone know how this can be accomplished?

Thanks,
Baljinder

Depths?
Im not even sure if I can ask this right.

I need, when button a is pressed to basically put layer one on top of layer 2

then when button b is pressed, I need them to switch again

Does that make sense?

Depths?
If got a problem with swapping depths...
This is what i've got in mind:

I want to have 3 squares to magnify when you rollover, in each square i want a different text to display when it becomes its largest size...
Because you have to read the text, when the square resizes it has to come on top.
The depth thing i got solved with buttons(from a movie from flashkit), but the problem now is, when i want to change the background or tekst in it, it changes every button...

Is it possible to load an external swf in the button without it having change all my buttons?

I uploaded the fla...I hope someone can help me because this whole thing is the concept of the website i want to create ;-)

Something like this: www.cgvimax.com after the intro...
I know this is to much for me, but i am trying to reach something like it...

I hope someone can teach me this...

Cheers!

[F8] Depths?
if i am adding about two movie clips a frame, (deleting two also..) each one using getHighestDepth, how would i make one movie clip that is always there, always have the highest depth?

sorry if im not making my self cear, im just trying to figure out how to make something stay infront of all the other movie clips..

Help With Depths
Hi,

Using the code


Code:
private function whenMouseDown(event:MouseEvent):void{

this.startDrag();
this.filters = [new DropShadowFilter()];

parent.setChildIndex(event.currentTarget, numChildren-12);

}


Gives me an error i dont understand why parent is defently the right location. the target is right but the depth just does not want to change any ideas?

Depths
Hi,
I have search all around and can't seem to get this right.
I'm using holder.createMovieClip('kit', 1);
This works fine. Now I need to create a movieClip in the next depth up so that when the image changes you can see the image below till it loads over the top.
This is the same image, just a different color.
I'm trying to be able to click on a color button and objects in the image appears to change color.
If I unload the movieClip and create another one, there is a moment when the image area is blank. Can't have that.
Can I load a new one and then delete the old one on the fly?
I suppose it also would not be too bad if they load one over the other except if this bogs the movie after a while.
Now that I am rambling, I hope this makes sense

Thanks for your help

Depths
hi,
Im having problems with depths, I don't need code I just need to know how flash reacts so i can rectify the problem.

A large number of mcs are attatched to the stage (100 or so) -around 30 of the 100 are attached to the same holder movie clip. These 30 are graphics. Of course trees and buildings can either be behind or infront of a character on the stage, so the depths of these are static. The depths of the characters are dynamic, now heres my problem. The character depth changes when it walks every second and sometimes the depth is the same as a tree for example.

1)If an mc is swapDepth() to a depth the same as an MC already on the stage, what should happen?

2) to rectify the problem will swapDepths work in decimals? say if I added .001 to the depths of the characters so they are never the same as the graphics.


3) Another thing also, it loads about 100kb of map data by loadVars() -Occasionally it seems to 'loose' some of the data and error out. Is it better to encorporate this map data into the actual swf file? will this be more reliable?

4) can anyone think of a workaround for my depths problem?

Thankyou
til

Depths
thanx for help on my previous question.
now that i've used some of your code, i've gotten everything relevent to the question completed, but i can't get the boxes i've been working with in back of everything where i need them to be. i have a few mc's on the stage i placed manually and they always go to the back of the newly attached boxes.

here is my code


Code:
_root.onLoad = function (){
var size = 15
for (q=0; q<=64; q++) {
this.attachMovie("box", "box"+q, q);
this["box"+q]._x = q%65*(size);
this["box"+q]._y = 7.5
};
};
i've tried alot of different methods to make it in back, but none work or they are buggy, i need a new solution :/

thanks in advance

Depths
Hi guys, I've got a button on the main fla which I would like to control it's depth in the as file i've got. I thought that by creating a number variable then saying closebtn.z = nameofvariable; would do the job but an error says "1119: Access of possibly undefined property z through a reference with static type flash.display:SimpleButton." What should I do? Thanks

MC Depths
hello,

i need help with finding out which mc is underneath the current one.
here is my code to attach movies, buttons "b1 through b5", and "words1 through words5" is the content. getting attached in "holder" on _root.


Code:

for (var i = 1; i<6; i++) {
_root.nav["b"+i].onPress = function() {
num = this._name.toString().substring(1, 2);
_root.holder.attachMovie("words"+num, "words"+num, _root.holder.getNextHighestDepth());
};
}
once it is attached how could i get the mc on the depth below it?

thanks for help anyone.

Depths.
Hey guys.

Okay...so I am doing a little Flash pop up ad (i hate them btw). I'm using that <param name="wmode" value="transparent"> code...everything is working great! BUT! I have a drag property set on my Flash ad and I also have Flash navigation on my site. Well, when I'm dragging the Flash ad around, it goes behind the Flash navigation. What is the script that I need to put in to swap the depths?

thanks.

Help With Mc Depths
Hello:

On the main timeline I have an itemdetail_mc, inside which is a detailthumb_mc (which loads an external image using onClipEvent(load)) and a watermark wm_mc. The watermark mc is on a higher layer in the Timeline than the detailthumb_mc, but when the external image loads, it loads over the watermark instead of under it. I tried using swapDepths, but this didn't help. Any suggestions?

onClipEvent (load) {
_root.itemdetail_mc.detailthumb_mc.swapDepths (_root.itemdetail_mc.wm_mc);
}

Depths
Hey guys- hope this makes sense...
I have 5 movieclips on the stage- when a corresponding button is clicked, I need the mc to move to the highest depth...
Is there something like swapDepths for multiple objects (something like nextHighestDepth)?
Any help would rule...

Depths, How To?
Hi all!

Great forum and lots to learn, this is my first post here. Now to my problem.

I have a menu in a clipholder and content in another clipholder. The menu is a drop down menu. Can I somehow make the drop downs going over the content clipholder. Some of the stuff in the content has to be over the menu clipholder. Does this make any sense? Hope it does. I saw something about getNextHighestDepth or something but I haven't figured it out.

Big thanks in advance.

Depths
I'm curious to know the relationship of depths of elements placed with flash's layers. I have some graphical UI elements within the application and then I attach buttons and functionality over it, however, I need to do some weaving and get a certain group of loaded MCs under a certain group of staged elements. Using a Negative depth would be easiest - but not to sure if thats possible or suggested. I also just want to know the relationship of "Placed" graphics in terms of the depth that gets assigned to them, so in the future I can manage them better.

Thoughts?

Depths
Hi guys, I've got a button on the main fla which I would like to control it's depth in the as file i've got. I thought that by creating a number variable then saying closebtn.z = nameofvariable; would do the job but an error says "1119: Access of possibly undefined property z through a reference with static type flash.display:SimpleButton." What should I do? Thanks

Swap Depths
hi, can anyone help?
i have 6 movie clips (windows) on the main stage with instance names of... about, news, contact, laboratory, portfolio and arcade.
i want them to swap depths but i can get to grips with it!
please help
thanks in advance
matt

Swap Depths Bug?
After swapping a draggable MC's depth in frame 1 loop between frame 3 and 2. On going to the previous frame the MC is duplicated ( but does not show as an object in Debugger!). Has anyone had this before or is it a bug( or am i just crap!). See code below and try it yourself.

create a MC with Instance name Target. Create a place in a new layer above a object i.e. a box, ( to check swapdepths works).

Frame1:
Target.swapDepths( 100 );
startDrag ("Target", true);

Frame2:
"No code"

Frame3:
gotoAndPlay (2);

Tried it with any loop i.e. frame 15 to 7, and the MC is duplicate when gotoAndPlay is executed.


Please help as i think i am going mad

Thanks

Swap Depths
Can someone help me with swapping depths between different movie levels.

In level 2 I have an mc called "am"
in level 3 i have an mc called "wrk"
in level 4 I have an mc called "rsme"


I load in all of the movies into different levels and each window is dragable, I want to be able to swap the depths of the one you click on to bring it ot the front.

?.swapdepth (?);

Any help would be greatly appreciative and a huge thanks in advance.

Jason

Swapping Depths
I'm looking for a solution to my little problem.

What I am trying to do is to swap the depths of two clips I attach to stage in the runtime
http://galileo.spaceports.com/~skd/scr.swf
'Craft Window' attaches a new 'window' clip to the stage with a name of "newindowX" (where X is the accumulator var) on depth equal to X.

What I want to achieve is on press of the drag bar (A button inside the window clip), I want to switch the depths of the clip on which I activate the button with the clip on top (it's depth is equal to the current value of X), thus bringing the needed clip on top of the stash.

What my problem is - I cannot yet get how to call swapDepths for the clip A by activating the event from inside the clip A (with the help of button, in my case).

Any help would be deeply appreciated.

Swap Depths....swf
Hi there!
Im having a bit of trouble figuring out how to swap depths with seperate swf files. I have a few swf files which are loaded into my main page which is on level 0.

If anyone has the answer I would be very thankful for your help.
If you want to check out my incomplete webpage go to the link below....

Swapping Depths
How can swap depths between more than two movieclips.. Please help

Layer Depths
I have 10 movie clip objects within a flash movie. On an onclick event I require the chosen movie clip to come to the top of the stack.

Any advice would be much appreciated

thanks in advance

Depths Nightmare
I have some button components that each one creates an empty mc to draw a curve on. How do I set the depth, so that every emty mc gets a different depth? They all execute at the same time, and I want the depth to be lower then the component.
As it is now, the empty drawing mcs has the same depth, but this screws up. Click here to have a look yourself--> http://webzone.k3.mah.se/kit01051/mx...interface.html

roll over all the buttons a few times, and you should see the nasty turn the design takes. I need your help, dude, this is ugly. Spanks u very much

Loadmovie Depths
I a want a button to load a movie over the last movie loaded using the "loadmovie" action,(it needs to slide over rather than replace) and then unload the last movie... if that makes sense...

this needs to happen from various buttons but needs to unload the last movie as the main movie just gets bogged down with all the loaded movies...

thanks

Swaping Depths....
These two MC's are on the same layer in the timeline.

Here is what I have made so far.....its a OS simulation....
I am wanting to get the "windows" / MC's to move "infront"
of each other.

Some code of swapDepths would be nice.


Now to my OS simulation....
Its caled GINW : Glad Its Not Windows...

Tell me if you like it.

(It needs flash MX player, so it can save your settings.)

One "Bug":
when "undocking"/"docking" a window,it sometimes moves to the wrong spot....Im tring to fix it.

Swap Depths ?
Does anyone know if swap depths - can make one layer appear as if it's above the next and swap 3 or 4 of them at the click of a button ?? Or something that'll do this ?

'depths' Problem
Happy Holidays to all!

I posted this over at Flash MX, but no one's replied yet. Got a project going where you can open up a few windows at once. I have the depth problem solved for the individual windows, but I also have a "tooltip" mc incorporated and the problem is that when the windows come to the top (only after they come to the top), my tooltips crash to the bottom and are hidden behind the windows! How can I make the tooltips come to the top regardless of all other level depths (like level 100 or whatever)? I tried a few scripts on the tooltip mc itself, but nothing seems to work. Is there something I can tell the tooltip mc (globally) to stay on top? Thanks for any advice.

Swapping Depths Of .swf's
i have three buttons...when clicked i want each button to open a window with more buttons, which when clicked on open other windows...

the first one i managed to do...it is draggable and collapsable, but i would like to know how to open the other windows, and then bring a window to the front when clicked on (i woud also love it if the ones in the background could by less opaque as well!)

thanks anyone and everyone!

MX Depths Explained
Next up, Depths. Pretty broad topic, but one that has come up a few times in the past couple of weeks so I thought Id finish up what I had previously written on the subject. Might be more to them than you think.

Because of the broadness and its lack of specific focus, its not as centralized as the others and may be a little less cohesive, though I think it does well enough. Mistakes may certainly well exist, so let me know when you catch them

http://www.kirupa.com/developer/actionscript/depths.htm

_____________________________________________


(last posted article on setInterval)

Depths Problem
is there any way to reset the depth of a movieclip? Is there something like a setDepth(int) method? I know there is a getDepth().

I have a movieClip on depth 4, is something like "myMovieClip.setDepth(1000)" possible?
(I know setDepth doesn't exist, but is there something similar)
thx

RemoveMovieClip - Depths?
Alright -

I've got a navigation. Most of buttons in the navigation place a movie clip onto the stage. I give each mc an instance and depth that is identical (1000), so that the next button will remove the initial mc and add a new one.

Here's my code for one button:
on (release) {
_level0.mcNavigation.attachMovie("webClip", "web", 1000);
_level0.mcNavigation.web._x = -91;
_level0.mcNavigation.web._y = 58;
}

Here's my problem. For one of my buttons I'm loading a movie (loadMovie) and can't figure out how to remove any movie clip sitting at the depth of 1000.

on (release) {
loadMovieNum("flash_other.swf", 1);
_level0.mcNavigation.removeMovieClip();

RemoveMovieClip - Depths?
Alright -

I've got a navigation. Most of buttons in the navigation place a movie clip onto the stage. I give each mc an instance and depth that is identical (1000), so that the next button pressed will remove the initial mc and add a new one.

Here's my code for one button:
on (release) {
_level0.mcNavigation.attachMovie("webClip", "web", 1000);
_level0.mcNavigation.web._x = -91;
_level0.mcNavigation.web._y = 58;
}

Here's my problem. For one of my buttons I'm loading a movie instead of attaching a mc. I can't figure out how to remove any movie clip sitting on the stage at the depth of 1000.

on (release) {
loadMovieNum("flash_other.swf", 1);
_level0.mcNavigation.removeMovieClip();
}

What am I missing here?
Thanks,
manOhman

Is There A Limitation To Depths?
I was curious before I took a lot of time and effort... is there a limitation to depths... how many depths can there be??? currently I am using 1006... is there an infinate amount of depths available in activescript???

Thanks,
Carlos

Sorting Depths
Hi. I am trying to make a 4-way scrolling tilemap game where every 16x16 tile is a seperate movie clip. Now I want it so that all the tiles and objects are sorted by their bottom pixel, so that the ones that have a lower bottom are in front of the ones that have a higher bottom. For example if the player's feet are higher than the trunk of a tree, the player appears behind the tree but if his feet are lower than the tree trunk, the player appears in front of the tree. I need it to do this for the players as well as NPC's, items, and enemies. I know that I could use swapdepth, but does anyone know a good tutorial on how to do it efficiently?

Depths Question
Hi,

If i had 2 clips called say Clip1, and Clip 2, then I attached 5 more clips to each Clip, so you end up with Clip1[a, b, c, d, e], Clip2[a, b, c, d, e]...would I have to set different depths for each of those clips?, so the Clip1 movies would be 1, 2, 3, 4, 5 and the Clip 2 movies would be 6, 7, 8, 9, 10?? OR....is it ok to have depths of 1-5 for each other Child clips? and they don't conflict?

thanks

phil.

Depths, Any Idea's?
Hi,

Quick simple question about depths.

Do all instances of clips no matter if they are children of other clips or not, have to have their own exclusive depth value OR can you have 1 lot of child clips have say 1-5 in depths, and another lot of child clips have 1-5 in depths, but because they are children of seperate parent clips, then thats ok??

i've looked at the depth article, and it seems a bit unclear on this point.

thanks

phil.

Understanding Depths
I am working on this seemly complex problem, that I believe is being caused by my lack of knowledge on how depths work.

My project (as of now) consist of a sliding menu bar, that slides out onRollover, and a small MC that reads "architects" and when rolled over reads "home".

My trouble is getting the rollOver for "architects" to "home" to work and also having that MC to go back to the beginning of the sliding menu MC on release.

My .fla is attached with all the actionsrcipt on it. But as my problem is, it is not working.

please help if possible! -thanks

MovieClip Depths
I need a way to set the depth of a movie clip so that i can have it on top of all the other movie clips. the reson i need to is because im using the duplicateMovieClip script and those duplicated mc's have depths from 1-50 so my other movie clip is always on the bottom and i tried the movieClip.swapDepths command and that doesnt help cause i want to set the movie clip's depth to really high - not swap it with another one's depth.

Any help would be appreciated. Thanks.

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