⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 depthmanager.as

📁 flash 视频聊天室源码,非常好的源码
💻 AS
📖 第 1 页 / 共 2 页
字号:
        {
            targetDepth = _loc5;
        } // end if
        if (depthTable[targetDepth] == undefined)
        {
            return (targetDepth);
        } // end if
        var _loc2 = targetDepth;
        var _loc1 = targetDepth;
        if (direction == "down")
        {
            while (depthTable[_loc1] != undefined)
            {
                --_loc1;
            } // end while
            return (_loc1);
        } // end if
        while (depthTable[_loc2] != undefined)
        {
            ++_loc2;
        } // end while
        return (_loc2);
    } // End of the function
    function shuffleDepths(subject, targetDepth, depthTable, direction)
    {
        var _loc9 = mx.managers.DepthManager.lowestDepth + mx.managers.DepthManager.numberOfAuthortimeLayers;
        var _loc8 = _loc9;
        var _loc5;
        for (var _loc5 in depthTable)
        {
            var _loc7 = depthTable[_loc5];
            if (_loc7._parent != undefined)
            {
                _loc9 = Math.min(_loc9, _loc7.getDepth());
            } // end if
        } // end of for...in
        if (direction == undefined)
        {
            if (subject.getDepth() > targetDepth)
            {
                direction = "up";
            }
            else
            {
                direction = "down";
            } // end if
        } // end else if
        var _loc1 = new Array();
        for (var _loc5 in depthTable)
        {
            _loc7 = depthTable[_loc5];
            if (_loc7._parent != undefined)
            {
                _loc1.push(_loc7);
            } // end if
        } // end of for...in
        _loc1.sort(mx.managers.DepthManager.sortFunction);
        if (direction == "up")
        {
            var _loc3;
            var _loc11;
            while (_loc1.length > 0)
            {
                _loc3 = _loc1.pop();
                if (_loc3 == subject)
                {
                    break;
                } // end if
            } // end while
            while (_loc1.length > 0)
            {
                _loc11 = subject.getDepth();
                _loc3 = _loc1.pop();
                var _loc4 = _loc3.getDepth();
                if (_loc11 > _loc4 + 1)
                {
                    if (_loc4 >= 0)
                    {
                        subject.swapDepths(_loc4 + 1);
                    }
                    else if (_loc11 > _loc8 && _loc4 < _loc8)
                    {
                        subject.swapDepths(_loc8);
                    } // end if
                } // end else if
                subject.swapDepths(_loc3);
                if (_loc4 == targetDepth)
                {
                    break;
                } // end if
            } // end while
        }
        else if (direction == "down")
        {
            while (_loc1.length > 0)
            {
                _loc3 = _loc1.shift();
                if (_loc3 == subject)
                {
                    break;
                } // end if
            } // end while
            while (_loc1.length > 0)
            {
                _loc11 = _loc3.getDepth();
                _loc3 = _loc1.shift();
                _loc4 = _loc3.getDepth();
                if (_loc11 < _loc4 - 1 && _loc4 > 0)
                {
                    subject.swapDepths(_loc4 - 1);
                } // end if
                subject.swapDepths(_loc3);
                if (_loc4 == targetDepth)
                {
                    break;
                } // end if
            } // end while
        } // end else if
    } // End of the function
    function getDepthByFlag(depthFlag, depthTable)
    {
        var _loc2 = 0;
        if (depthFlag == mx.managers.DepthManager.kTop || depthFlag == mx.managers.DepthManager.kNotopmost)
        {
            var _loc5 = 0;
            var _loc7 = false;
            var _loc8;
            for (var _loc8 in depthTable)
            {
                var _loc9 = depthTable[_loc8];
                var _loc3 = typeof(_loc9);
                if (_loc3 == "movieclip" || _loc3 == "object" && _loc9.__getTextFormat != undefined)
                {
                    if (_loc9.getDepth() <= mx.managers.DepthManager.highestDepth)
                    {
                        if (!_loc9._topmost)
                        {
                            _loc2 = Math.max(_loc2, _loc9.getDepth());
                            continue;
                        } // end if
                        if (!_loc7)
                        {
                            _loc5 = _loc9.getDepth();
                            _loc7 = true;
                            continue;
                        } // end if
                        _loc5 = Math.min(_loc5, _loc9.getDepth());
                    } // end if
                } // end if
            } // end of for...in
            _loc2 = _loc2 + 20;
            if (_loc7)
            {
                if (_loc2 >= _loc5)
                {
                    _loc2 = _loc5 - 1;
                } // end if
            } // end if
        }
        else if (depthFlag == mx.managers.DepthManager.kBottom)
        {
            for (var _loc8 in depthTable)
            {
                _loc9 = depthTable[_loc8];
                _loc3 = typeof(_loc9);
                if (_loc3 == "movieclip" || _loc3 == "object" && _loc9.__getTextFormat != undefined)
                {
                    if (_loc9.getDepth() <= mx.managers.DepthManager.highestDepth)
                    {
                        _loc2 = Math.min(_loc2, _loc9.getDepth());
                    } // end if
                } // end if
            } // end of for...in
            _loc2 = _loc2 - 20;
        }
        else if (depthFlag == mx.managers.DepthManager.kTopmost)
        {
            for (var _loc8 in depthTable)
            {
                _loc9 = depthTable[_loc8];
                _loc3 = typeof(_loc9);
                if (_loc3 == "movieclip" || _loc3 == "object" && _loc9.__getTextFormat != undefined)
                {
                    if (_loc9.getDepth() <= mx.managers.DepthManager.highestDepth)
                    {
                        _loc2 = Math.max(_loc2, _loc9.getDepth());
                    } // end if
                } // end if
            } // end of for...in
            _loc2 = _loc2 + 100;
        } // end else if
        if (_loc2 >= mx.managers.DepthManager.highestDepth)
        {
            _loc2 = mx.managers.DepthManager.highestDepth;
        } // end if
        var _loc6 = mx.managers.DepthManager.lowestDepth + mx.managers.DepthManager.numberOfAuthortimeLayers;
        for (var _loc9 in depthTable)
        {
            var _loc4 = depthTable[_loc9];
            if (_loc4._parent != undefined)
            {
                _loc6 = Math.min(_loc6, _loc4.getDepth());
            } // end if
        } // end of for...in
        if (_loc2 <= _loc6)
        {
            _loc2 = _loc6;
        } // end if
        return (_loc2);
    } // End of the function
    function buildDepthTable(Void)
    {
        var _loc5 = new Array();
        var _loc4;
        for (var _loc4 in this)
        {
            var _loc2 = this[_loc4];
            var _loc3 = typeof(_loc2);
            if (_loc3 == "movieclip" || _loc3 == "object" && _loc2.__getTextFormat != undefined)
            {
                if (_loc2._parent == this)
                {
                    _loc5[_loc2.getDepth()] = _loc2;
                } // end if
            } // end if
        } // end of for...in
        return (_loc5);
    } // End of the function
    static var reservedDepth = 1048575;
    static var highestDepth = 1048574;
    static var lowestDepth = -16383;
    static var numberOfAuthortimeLayers = 383;
    static var kCursor = 101;
    static var kTooltip = 102;
    static var kTop = 201;
    static var kBottom = 202;
    static var kTopmost = 203;
    static var kNotopmost = 204;
    static var holder = _root.createEmptyMovieClip("reserved", mx.managers.DepthManager.reservedDepth);
    static var __depthManager = new mx.managers.DepthManager();
} // End of Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -