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




Levels Or Depths



I have attached a .fla file I am working on for xmas. The action script makes
dynamic snow flakes and on a layer above it i made some clouds. My question is this. how do I make the snow flakes go behind the movieclips of the clouds instead of in front of them. could someone pleas look at this file.




View Complete Forum Thread with Replies

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

Levels And Depths?
Can anyone explain to me what the difference between level and depth is and what the uses for each would be?

Thanks!

Swap Depths With Levels 1,2,3
hi

i would like to swap depths with levels (not MCs) 1,2,3 of my movie on(press)..anyone have any ideas how to make the one clicked to come to the front? thanks!

Depths Or Levels Problem?
I have an SWF that plays other SWF's inside it. one of the SWF's let's you register your email. the problem is that you can't actually see the input box. I tried a regular input box and dynamically creating it and still no dice. just your regular

createTextField("email", 1000, 100, 150, 100, 20);

like i said above i think it's a depth or levels problem but i'm not sure what to do. I'd appreciate any help thanks.

Problem With Depths Or Levels....I Think
I'm playing around with actionscript for a starry sky effect that I found somewhere( can't remember where) , and the problem is that the stars are overlapping everything on the stage, when I only want them in the background. I've tried changing the depth with numbers, I've tried

Code:
this.getNextHighestDepth
and a bunch of stuff I can't even remember now, and the stars still cover anything else I put on the stage.
I also tried loading it externally into another movieclip, in another flash movie, and doing that made the stars dissapear- ( only the rectangle set as a back ground shows up)
I'm not great at actionscript and am trying to learn it, so if this is obvious, be kind
Any help or input anyone has would be great...like I said, I'm just learning, so it may take some explaining before it sinks in with me


Quote:




Edit:--I figured it out.

Levels Vs. Depths & Switching
Hi,

I am currently using Levels to load new movies into the player as buttons are hit by the user -- this method is allowing me to 2 things that I want to keep:
1. new content animates over old content (fades in etc)
2. I can unload previous levels to free them and memory

However, I'd like to know if I could acomplish this using Depths instead of Levels as I've read that Depths for several reasons are preferable, so I'm looking for help in switching to Depths and any feedback on which may be better (and why) -- thanks in advance:
here's what I'm doing now with levels (thanks to this forum - I think OldNewbie or Flash Gordon helped me out originally if I remember right):

Declare two variables at start:

levelvar=5;
removevar=(levelvar - 2)

Then on the Buttons (for example, "Contact Us"):

on (release) {
loadMovieNum("contact.swf", _level0.levelvar);
_level0.removevar = _level0.levelvar-2;
_level0.levelvar++;
//dont want to undload level0
if (removevar>0) {
unloadMovieNum(_level0.removevar);
}
}

How would this be done with Depths and would that be preferable?
Thanks very much!!!

Levels ,Depths And DuplicatingMC Help
I making a game in which i duplicate bad guys. I also have a custom crosshair. When I duplicate a bad guy it automaticaly appears infront of my crosshairs. I dont know if i need to set a depth for my crosshair because i have no idea how. I can only seem find ways to read levels and depths but not set them. Thank you.

[F8] I Thought I Understood Depths Vs. Levels, But...
I am taking a movieclip that used to be a root movie and loading it into a larger movie. The movie that used to be the root loads movies onto levels. These level movies no longer load into the correct position, because they still appear in the upper left of the new root movie.

I was able to do a partial fix with the following:

createEmptyMovieClip("holder" , "1");
loadMovie("new.swf" , "holder");
_level1.holder.x=25;
_level1.holder.y=22;

This loads the movies into the correct x, y position but i can no longer use the "unloadMovieNum(1);" to make it go away. This seems to be because the "1" in the createEmtpyMovieClip movie is a depth instead of a level. The weird thing then is that the script above works at all, since it is loading the movie into depth 1 and not _level1. Why does calling it on _level1 work for the coordinates?

What's going on here?

On looking at this further, its seems to work when I say any level number, so this script must just be ignoring the _level. I'd like to be able to do the same thing as above except using a level instead of a depth.

It looks like the thing to do will be change all clips that load and unload on levels to be created on depths instead and then use removeMovieClip instead of unloading.

Depths / Levels Guru Needed
I have read all the obvious stuff about the depths / levels it seems. But, am still missing something!

The issue (I run into often): Even though I assign the actual depth number, the loadedmovie still either isn't "present" or is hidden behind a loadedmovie that's at a LOWER depth.

Main functions are defined at the main foundational swf. From the main foundational swf, I call all other swf movies, flvs, or whatever. In my main swf, for instance, the flvs loaded in are given a depth of 4000 (I'm compelled to do high numbers now) while title.swf (it runs over the flv) is loaded in at a depth of 8000. I would think I could assign title.swf to 4001 and it would be on top, but it's playing behind my flv at 4000 even though it is put at the 8000 depth.

are there rules that include overriding or what could explain this? or am i misunderstanding levels versus depth?

thank you!

[F8] Talking About Levels..controling Levels, Loading Swfs Into Levels, Etc
Hello, people!

I have a little tweaking i need to adjust.

To get to the point:


if (1==1)
{
loadMovieNum("test.swf", 3);

_level3.gotoAndStop(10);
}
else (...)


The problem is that on the if cycle, it doesnt consider the level as being loaded. I've tryed a while to wait for the level to load, nothing worked.

I've tested with a button to see if the level exist and is possible to control it and it is, with the onRelase.button etc etc.

Any ideas?

Ricardo

Thanks!

[levels] Snapto And _levels Targeting Levels
This code is on the root of a movie, it workks fine. However, when i load it into level 100(from another movie) , the snap-to code no longer works.

I've worked with levels a lot, but this really stumps me.

I've tried many many variations to taget the correct path, _levels. _root, this._name, targetPath,

The basic code appear below.

//code on root movie
onEnterFrame = fsnapto;
function fsnapto(){
//trace("pushed @ snapto ==" +choices);
// target1
area_oftarget_x = target1._x;
area_oftarget_y = target1._y;
//target2
area_oftarget_x2 = _root.target2._x;
area_oftarget_y2 = _root.target2._y;
}
// == end snap to==


// code on buttons
on(release){
if(_root.a3._droptarget == "/target1"){
trace("dropped 3================" +this.targetPath);
_root.fchoice("a3");
_root.a3._x= area_oftarget_x;
_root.a3._y= area_oftarget_y;
}
}

Swapping Levels - Levels Infinate?
Hi

im trying to produce a little news panel that you can swap between news items. The problem im having is the following... when I click a 'next' button I want a new story swf to load over the top - and so on for anouther 5 or 6 times. I want to be able to click forwrd randomly between stories - BUT how do I make sure that the next storie loaded is always on the next level up - and that the last swf is unloaded when the new one has loaded?

thanks for your help

PS: I thought of just putting all the news items in the same SWF but this would meen loading them and all their pictures at the same time and also make it harder to change/update indivdual stories

Conflicting Levels? Too Many Levels?
I've been working on this pattern maker and I have a movie clip that is basically a pixel. I duplicated that movie clip 1024 times using the following code:

for (y=0; y < 32; y++) {
for (x=0; x < 32; x++) {
_root.newName = "sampleMovie" + ((y * 32) + x);
duplicateMovieClip (sampleMovie, _root.newName, ((y * 32) + x));
xPos = getProperty(newName, _x);
yPos = getProperty(newName, _y);
setProperty(newName, _x, (x*movWidth) + xPos);
setProperty(newName, _y, (y*movHeight) + yPos);
}
}

Well, I tried duplicating another movie clip the same way with a slightly different code as follows:

for (a=0; a < 32; a++) {
for (b=0; b < 32; b++) {
_root.gridName = "grid" + ((b * 32) + a);
duplicateMovieClip (grid, _root.gridName, ((b * 2048) + a));
xPosG = getProperty(gridName, _x);
yPosG = getProperty(gridName, _y);
setProperty(gridName, _x, (a*movWidth) + xPosG);
setProperty(gridName, _y, (b*movHeight) + yPosG);
}
}

When I did that it duplicated the "grid" movie clips, but it didn't duplicate the "sampleMovie" movie clips. I figured it was because there were conflicting levels. So what I did was made a horizontal rule and just tried duplicating that just 32 times using the following code:

for (a=0; a < 32; a++) {
xLine = "horLine" + a;
duplicateMovieClip (horLine, xLine, a + 1025);
xAxis = getProperty(xLine, _y);
setProperty(xLine, _y, xAxis + 10.4);
}

This code only duplicated the movie twice. Am I using too many levels? How many levels can Flash recognize? The first code I showed produced 1,024 levels of movie clips and worked fine. Why would that last code only duplicate it twice instead of 32 times? Thanks for the help.

Levels, Jerry, Levels
Anyone who how to change a movie's level with a command? Sorta like swapdepths but for levels. I'm tryin got get a movie to basically go from being on level1 to levelo and replacing the movie in level0. I've asked in the newbies sections but no one knew for sure. Was hoping you guys would have a little something for me.

Vij'n

[F8] Controling Levels From Other Levels
Hi all,
I would like to have a button on level 0, that loads a swf on level one. In the swf loaded on level one I want to have another button wich controls a movieclip on level 0. Is that possible? I don't want to use containers, but use loadMovie("movie.swf", 1) method. Any ideas?
Thank you

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

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

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