Thats great! exactly what I was looking for.

cheers,
Darren

On 07/08/07, Jack Doyle <[EMAIL PROTECTED]> wrote:
>
> I ran into the same problems a while back. I created a LevelsManager class
> to get around it which you can set to "hijack" the getNextHighestDepth()
> function. That way, you can run one line of code at the beginning of your
> application and all your getNextHighestDepth() calls will work regardless
> of
> whether or not there are components on the stage. You can download the
> small
> class file at http://www.greensock.com/ActionScript/LevelsManager.zip.
> Here
> is the primary function I used in that class:
>
> function getNextHighestDepth(mc:Object):Number {
>         if (mc == undefined) {mc = this};
>         var maxDepth_num:Number = mc.getNextHighestDepth();
>         if (maxDepth_num != undefined && maxDepth_num < 16000) {
>                 return maxDepth_num;
>         } else {
>                 maxDepth_num = -1;
>                 var depth_num:Number;
>                 var obj:Object;
>                 var tf = TextField.prototype;
>                 for (var p in mc) {
>                         obj = mc[p];
>                         if ((typeof(obj) == "movieclip" || obj.__proto__
> ==
> tf) && obj._parent == mc) {
>                                 depth_num = obj.getDepth();
>                                 if (depth_num > maxDepth_num && depth_num
> <
> 16000) {
>                                         maxDepth_num = depth_num;
>                                 }
>                         }
>                 }
>                 return maxDepth_num + 1;
>         }
> }
>
> Jack
>
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to