all groups > flash actionscript > april 2005 >
You're in the

flash actionscript

group:

Dynamic Levels


Dynamic Levels QuantumDynamix
4/9/2005 12:00:00 AM
flash actionscript:
Now here is something I could have sworn I would find in the help file for
_level, but of course, it wasn't there. I have a random number of movie
clips loaded, each at different depths. Basically, for placement purposes, I
need to reference the last item i just place to recover its y position. so, I
want to write something like this: yLoc = _level[nextDepth-1]._y Where
nextDepth is a numeric variable. The above line of code does not work. Does
anyone know how to write this so it uses a dynamic level number? Thanks
Re: Dynamic Levels I flash therefore I am
4/9/2005 12:00:00 AM
what method are you using to load your random clips that assigne their
depths? Levels are a completely different issue and have nothing to do with
depths. How do you know what the last item you placed was? Will the last
item always be at the highest depth? (which brings me back to the first
question).


[quoted text, click to view]

Re: Dynamic Levels I flash therefore I am
4/9/2005 12:00:00 AM
Well assuming there is a reason why you don't have any idea what the last
thing you just did was and assuming you are assigning your depths with
getNextHighestDepth (or any incremental depth counter that places your last
item at the top depth).

yLoc = this.getInstanceAtDepth(this.getNextHighestDepth()-1)._y;

Re: Dynamic Levels QuantumDynamix
4/9/2005 12:00:00 AM
That did it. Works great. But I do have a question. N, in _levelN, that does
not stand for the depth of the item? I couldn't write 'movieClip._levelN' and
that be the object a the N depth of that movieClip? Just curious what N is.
Thanks for the help.
Re: Dynamic Levels I flash therefore I am
4/9/2005 12:00:00 AM
If you look up _level in the help file, note that it says "you must use
loadMovieNum"

then go look up loadMovieNum. Depths and _levels have nothing to do with
each other.

If you want to put it in SAT perspective, depths are to movieclips as
_levels are to movies.

[quoted text, click to view]

AddThis Social Bookmark Button