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

📄 binding.as

📁 如遇MD5加密文件
💻 AS
📖 第 1 页 / 共 2 页
字号:
        for (var _loc4 in info.settings)
        {
            _loc3[_loc4] = info.settings[_loc4];
        } // end of for...in
        return (_loc3);
    } // End of the function
    static function refreshFromSources(component, property, bindings)
    {
        var _loc5 = null;
        var _loc3;
        for (var _loc3 = 0; _loc3 < bindings.length; ++_loc3)
        {
            var _loc1 = bindings[_loc3];
            var _loc2 = null;
            if (_loc1.dest.component == component && (property == null || property == _loc1.dest.property))
            {
                _loc2 = _loc1.execute();
            }
            else if (_loc1.is2way && _loc1.source.component == component && (property == null || property == _loc1.source.property))
            {
                _loc2 = _loc1.execute(true);
            } // end else if
            if (_loc2 != null)
            {
                _loc5 = _loc5 == null ? (_loc2) : (_loc5.concat(_loc2));
            } // end if
        } // end of for
        return (_loc5);
    } // End of the function
    static function refreshDestinations(component, bindings)
    {
        var _loc1;
        for (var _loc1 = 0; _loc1 < bindings.length; ++_loc1)
        {
            var _loc2 = bindings[_loc1];
            if (_loc2.source.component == component)
            {
                _loc2.execute();
                continue;
            } // end if
            if (_loc2.is2way && _loc2.dest.component == component)
            {
                _loc2.execute(true);
            } // end if
        } // end of for
        for (var _loc1 = 0; _loc1 < component.__indexBindings.length; ++_loc1)
        {
            var _loc3 = component.__indexBindings[_loc1];
            _loc3.binding.execute(_loc3.reverse);
        } // end of for
    } // End of the function
    static function okToCallGetterFromSetter()
    {
        function setter(val)
        {
            value2 = value;
        } // End of the function
        function getter()
        {
            return (5);
        } // End of the function
        var _loc2 = new Object();
        _loc2.addProperty("value", getter, setter);
        _loc2.value = 0;
        var _loc3 = _loc2.value2 == _loc2.value;
        return (_loc3);
    } // End of the function
    function setUpListener(endpoint, reverse)
    {
        var _loc4 = new Object();
        _loc4.binding = this;
        _loc4.property = endpoint.property;
        _loc4.reverse = reverse;
        _loc4.immediate = mx.data.binding.Binding.okToCallGetterFromSetter();
        _loc4.handleEvent = function (event)
        {
            _global.__dataLogger.logData(event.target, "Data of property \'<property>\' has changed. <immediate>.", this);
            if (immediate)
            {
                if (binding.executing != true)
                {
                    binding.executing = true;
                    binding.execute(reverse);
                    binding.executing = false;
                } // end if
            }
            else
            {
                binding.queueForExecute(reverse);
            } // end else if
        };
        if (endpoint.event instanceof Array)
        {
            for (var _loc5 in endpoint.event)
            {
                endpoint.component.__addHighPrioEventListener(endpoint.event[_loc5], _loc4);
            } // end of for...in
        }
        else
        {
            endpoint.component.__addHighPrioEventListener(endpoint.event, _loc4);
        } // end else if
        mx.data.binding.ComponentMixins.initComponent(endpoint.component);
    } // End of the function
    function setUpIndexListeners(endpoint, reverse)
    {
        if (endpoint.location.indices != undefined)
        {
            for (var _loc3 = 0; _loc3 < endpoint.location.indices.length; ++_loc3)
            {
                var _loc2 = endpoint.location.indices[_loc3];
                if (_loc2.component != undefined)
                {
                    this.setUpListener(_loc2, reverse);
                    if (_loc2.component.__indexBindings == undefined)
                    {
                        _loc2.component.__indexBindings = new Array();
                    } // end if
                    _loc2.component.__indexBindings.push({binding: this, reverse: reverse});
                } // end if
            } // end of for
        } // end if
    } // End of the function
    static function copyBinding(b)
    {
        var _loc1 = new Object();
        _loc1.source = mx.data.binding.Binding.copyEndPoint(b.source);
        _loc1.dest = mx.data.binding.Binding.copyEndPoint(b.dest);
        _loc1.format = b.format;
        _loc1.is2way = b.is2way;
        return (_loc1);
    } // End of the function
    static function copyEndPoint(e)
    {
        var _loc1 = new Object();
        _loc1.constant = e.constant;
        _loc1.component = String(e.component);
        _loc1.event = e.event;
        _loc1.location = e.location;
        _loc1.property = e.property;
        return (_loc1);
    } // End of the function
    static function registerScreen(screen, id)
    {
        var symbol = mx.data.binding.Binding.screenRegistry[id];
        if (symbol == null)
        {
            mx.data.binding.Binding.screenRegistry[id] = {symbolPath: String(screen), bindings: [], id: id};
            return;
        } // end if
        if (symbol.symbolPath == String(screen))
        {
            return;
        } // end if
        var instancePath = String(screen);
        var i = 0;
        while (i < mx.data.binding.Binding.bindingRegistry.length)
        {
            var b = mx.data.binding.Binding.bindingRegistry[i];
            var src = mx.data.binding.Binding.copyEndPoint(b.source);
            var dst = mx.data.binding.Binding.copyEndPoint(b.dest);
            var prefix = symbol.symbolPath + ".";
            var symbolContainsSource = prefix == b.source.component.substr(0, prefix.length);
            var symbolContainsDest = prefix == b.dest.component.substr(0, prefix.length);
            if (symbolContainsSource)
            {
                if (symbolContainsDest)
                {
                    src.component = eval(instancePath + src.component.substr(symbol.symbolPath.length));
                    dst.component = eval(instancePath + dst.component.substr(symbol.symbolPath.length));
                    new mx.data.binding.Binding(src, dst, b.format, b.is2way);
                }
                else
                {
                    src.component = eval(instancePath + src.component.substr(symbol.symbolPath.length));
                    dst.component = eval(dst.component);
                    new mx.data.binding.Binding(src, dst, b.format, b.is2way);
                } // end else if
            }
            else if (symbolContainsDest)
            {
                src.component = eval(src.component);
                dst.component = eval(instancePath + dst.component.substr(symbol.symbolPath.length));
                new mx.data.binding.Binding(src, dst, b.format, b.is2way);
                
            } // end else if
            ++i;
        } // end while
    } // End of the function
    static function registerBinding(binding)
    {
        var _loc1 = mx.data.binding.Binding.copyBinding(binding);
        mx.data.binding.Binding.bindingRegistry.push(_loc1);
    } // End of the function
    static function getLocalRoot(clip)
    {
        var _loc2;
        var _loc3 = clip._url;
        while (clip != null)
        {
            if (clip._url != _loc3)
            {
                break;
            } // end if
            _loc2 = clip;
            clip = clip._parent;
        } // end while
        return (_loc2);
    } // End of the function
    var queued = false;
    var reverse = false;
    static var counter = 0;
    static var screenRegistry = new Object();
    static var bindingRegistry = new Array();
} // End of Class

⌨️ 快捷键说明

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