Could someone please tell me what the code is for finding out what depth a movie clip occupies. The Mc's name is s1 - I know you use the trace but don't know the code to use.
Find Out What Depth A Mc Is Atusing trace
Page 1 of 1
4 Replies - 6357 Views - Last Post: 26 January 2005 - 01:36 AM
Replies To: Find Out What Depth A Mc Is At
#2
Re: Find Out What Depth A Mc Is At
Posted 25 January 2005 - 02:58 AM
when testing a movie clip in flash (ie. Ctrl+Enter), select Debug from the top menu and choose either of the options. Try "List Variables" first. You'll get a more detailed view of what's happening in your movie clip.
It might be a lot of info if you have a lot of things in your movie.
If you are using Flash MX 2004, and have given a particular mc a level dynamicaly (mc._level = 200) then you can do a trace like so...
You might find it useful to, at the begining of your movie, tell the mc in which level it should be in, therefore you won't have to search for it.
To be honest I've never used _levels. If I needed an mc over-the-top of another mc, I use the .swapDepths() function:
It might be a lot of info if you have a lot of things in your movie.
If you are using Flash MX 2004, and have given a particular mc a level dynamicaly (mc._level = 200) then you can do a trace like so...
trace(mc._level);
You might find it useful to, at the begining of your movie, tell the mc in which level it should be in, therefore you won't have to search for it.
To be honest I've never used _levels. If I needed an mc over-the-top of another mc, I use the .swapDepths() function:
// Say, mc1 is BELOW mc2. If we want mc1 ABOVE mc2 we... mc1.swapDepths(mc2);
#3
Re: Find Out What Depth A Mc Is At
Posted 25 January 2005 - 03:41 AM
you can also try this.. just wrote it. I think it should do the trick, too.
paste it in the first frame of your movie, then call it anywhere in your movie by using: testDepth();
[edit] thought I should mention, this code should be used as a guide to predict/guess the depth of the objects. It is not 100% accurate. It does NOT get the actual depth of the movieclip. It does, however, give a very good estimate
[edit2] slightly edited the code. It now shows variables and functions.
function testDepth() {
props = new Array();
for (prop in this) {
ref = eval(prop)._name;
if (ref == undefined) {
props.push("function or other");
} else {
props.push(ref);
}
}
trace("-------------" + newline + "Object depths" + newline);
props.reverse();
for (var i = 0; i < props.length; i++) {
trace(props[i] + " = " + (i + 1));
}
}
paste it in the first frame of your movie, then call it anywhere in your movie by using: testDepth();
[edit] thought I should mention, this code should be used as a guide to predict/guess the depth of the objects. It is not 100% accurate. It does NOT get the actual depth of the movieclip. It does, however, give a very good estimate
[edit2] slightly edited the code. It now shows variables and functions.
This post has been edited by Red|5: 26 January 2005 - 02:17 AM
#4
Re: Find Out What Depth A Mc Is At
Posted 25 January 2005 - 06:06 PM
Maaaaaate,
Thanks for that. What seens to be happening with this movie is that the imported swf is taking over the timeline. I have an empty mc called "s1" (600x419) on a screen which is 800x600. The code to import the movie is on a button at the bottom of the screen ie -on (press) {loadMovie("test.swf",s1);
}.
On a previous screen with menus I have - fscommand"(fullscreen","true") - the movie runs fullscreen and everything works until I click the button then everything resizes to 600x419 and the import still runs on the screen and fills the s1 area (now smaller). When I stuck test in which had different dimensions it all resized - however the larger clip with a width of 640 and...look mate I'll zip and send...o.k And don't forget the lamb - its Australia Day
[COLOR=blue]
Thanks for that. What seens to be happening with this movie is that the imported swf is taking over the timeline. I have an empty mc called "s1" (600x419) on a screen which is 800x600. The code to import the movie is on a button at the bottom of the screen ie -on (press) {loadMovie("test.swf",s1);
}.
On a previous screen with menus I have - fscommand"(fullscreen","true") - the movie runs fullscreen and everything works until I click the button then everything resizes to 600x419 and the import still runs on the screen and fills the s1 area (now smaller). When I stuck test in which had different dimensions it all resized - however the larger clip with a width of 640 and...look mate I'll zip and send...o.k And don't forget the lamb - its Australia Day
[COLOR=blue]
#5
Re: Find Out What Depth A Mc Is At
Posted 26 January 2005 - 01:36 AM
Oh shit! I forgot (well sort of)...
I wanted to bring a flag to work here... small one.. but forgot
Happy Australia Day!!
woooooo! fireworks at Darling Harbour again...
I wanted to bring a flag to work here... small one.. but forgot
Happy Australia Day!!
woooooo! fireworks at Darling Harbour again...
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|