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

📄 simplebutton.as

📁 flash 视频聊天室源码,非常好的源码
💻 AS
📖 第 1 页 / 共 2 页
字号:
        {
            this.setState(false);
        } // end if
    } // End of the function
    function getToggle(Void)
    {
        return (__toggle);
    } // End of the function
    function set toggle(val)
    {
        this.setToggle(val);
        //return (this.toggle());
        null;
    } // End of the function
    function get toggle()
    {
        return (this.getToggle());
    } // End of the function
    function set value(val)
    {
        this.setSelected(val);
        //return (this.value());
        null;
    } // End of the function
    function get value()
    {
        return (this.getSelected());
    } // End of the function
    function set selected(val)
    {
        this.setSelected(val);
        //return (this.selected());
        null;
    } // End of the function
    function get selected()
    {
        return (this.getSelected());
    } // End of the function
    function setSelected(val)
    {
        if (__toggle)
        {
            this.setState(val);
        }
        else
        {
            this.setState(initializing ? (val) : (__state));
        } // end else if
    } // End of the function
    function getSelected()
    {
        return (__state);
    } // End of the function
    function setEnabled(val)
    {
        if (enabled != val)
        {
            super.setEnabled(val);
            this.invalidate();
        } // end if
    } // End of the function
    function onPress(Void)
    {
        this.pressFocus();
        phase = "down";
        this.refresh();
        this.dispatchEvent({type: "buttonDown"});
        if (autoRepeat)
        {
            interval = setInterval(this, "onPressDelay", this.getStyle("repeatDelay"));
        } // end if
    } // End of the function
    function onPressDelay(Void)
    {
        this.dispatchEvent({type: "buttonDown"});
        if (autoRepeat)
        {
            clearInterval(interval);
            interval = setInterval(this, "onPressRepeat", this.getStyle("repeatInterval"));
        } // end if
    } // End of the function
    function onPressRepeat(Void)
    {
        this.dispatchEvent({type: "buttonDown"});
        updateAfterEvent();
    } // End of the function
    function onRelease(Void)
    {
        this.releaseFocus();
        phase = "rollover";
        if (interval != undefined)
        {
            clearInterval(interval);
            delete this.interval;
        } // end if
        if (this.getToggle())
        {
            this.setState(!this.getState());
        }
        else
        {
            this.refresh();
        } // end else if
        this.dispatchEvent({type: "click"});
    } // End of the function
    function onDragOut(Void)
    {
        phase = "up";
        this.refresh();
        this.dispatchEvent({type: "buttonDragOut"});
    } // End of the function
    function onDragOver(Void)
    {
        if (phase != "up")
        {
            this.onPress();
            return;
        }
        else
        {
            phase = "down";
            this.refresh();
        } // end else if
    } // End of the function
    function onReleaseOutside(Void)
    {
        this.releaseFocus();
        phase = "up";
        if (interval != undefined)
        {
            clearInterval(interval);
            delete this.interval;
        } // end if
    } // End of the function
    function onRollOver(Void)
    {
        phase = "rollover";
        this.refresh();
    } // End of the function
    function onRollOut(Void)
    {
        phase = "up";
        this.refresh();
    } // End of the function
    function getLabel(Void)
    {
        return (fui.text);
    } // End of the function
    function setLabel(val)
    {
        if (typeof(fui) == "string")
        {
            this.createLabel("fui", 8, val);
            fui.styleName = this;
        }
        else
        {
            fui.text = val;
        } // end else if
        var _loc4 = fui._getTextFormat();
        var _loc2 = _loc4.getTextExtent2(val);
        fui._width = _loc2.width + 5;
        fui._height = _loc2.height + 5;
        iconName = fui;
        this.setView(__state);
    } // End of the function
    function get emphasized()
    {
        return (__emphasized);
    } // End of the function
    function set emphasized(val)
    {
        __emphasized = val;
        for (var _loc2 = 0; _loc2 < 8; ++_loc2)
        {
            idNames[_loc2] = stateNames[_loc2] + "Skin";
            if (typeof(this[idNames[_loc2 + 8]]) == "movieclip")
            {
                idNames[_loc2 + 8] = stateNames[_loc2] + "Icon";
            } // end if
        } // end of for
        this.showEmphasized(__emphasized);
        this.setStateVar(__state);
        this.invalidateStyle();
        //return (this.emphasized());
        null;
    } // End of the function
    function keyDown(e)
    {
        if (e.code == 32)
        {
            this.onPress();
        } // end if
    } // End of the function
    function keyUp(e)
    {
        if (e.code == 32)
        {
            this.onRelease();
        } // end if
    } // End of the function
    function onKillFocus(newFocus)
    {
        super.onKillFocus();
        if (phase != "up")
        {
            phase = "up";
            this.refresh();
        } // end if
    } // End of the function
    static var symbolName = "SimpleButton";
    static var symbolOwner = mx.controls.SimpleButton;
    static var version = "2.0.1.78";
    var className = "SimpleButton";
    var style3dInset = 4;
    var btnOffset = 1;
    var __toggle = false;
    var __state = false;
    var __emphasized = false;
    var __emphatic = false;
    static var falseUp = 0;
    static var falseDown = 1;
    static var falseOver = 2;
    static var falseDisabled = 3;
    static var trueUp = 4;
    static var trueDown = 5;
    static var trueOver = 6;
    static var trueDisabled = 7;
    var falseUpSkin = "SimpleButtonUp";
    var falseDownSkin = "SimpleButtonIn";
    var falseOverSkin = "";
    var falseDisabledSkin = "SimpleButtonUp";
    var trueUpSkin = "SimpleButtonIn";
    var trueDownSkin = "";
    var trueOverSkin = "";
    var trueDisabledSkin = "SimpleButtonIn";
    var falseUpIcon = "";
    var falseDownIcon = "";
    var falseOverIcon = "";
    var falseDisabledIcon = "";
    var trueUpIcon = "";
    var trueDownIcon = "";
    var trueOverIcon = "";
    var trueDisabledIcon = "";
    var phase = "up";
    var fui = "falseUpIcon";
    var fus = "falseUpSkin";
    var fdi = "falseDownIcon";
    var fds = "falseDownSkin";
    var frs = "falseOverSkin";
    var fri = "falseOverIcon";
    var dfi = "falseDisabledIcon";
    var dfs = "falseDisabledSkin";
    var tui = "trueUpIcon";
    var tus = "trueUpSkin";
    var tdi = "trueDownIcon";
    var tds = "trueDownSkin";
    var trs = "trueOverSkin";
    var tri = "trueOverIcon";
    var dts = "trueDisabledSkin";
    var dti = "trueDisabledIcon";
    var rolloverSkin = mx.controls.SimpleButton.prototype.frs;
    var rolloverIcon = mx.controls.SimpleButton.prototype.fri;
    var upSkin = mx.controls.SimpleButton.prototype.fus;
    var downSkin = mx.controls.SimpleButton.prototype.fds;
    var disabledSkin = mx.controls.SimpleButton.prototype.dfs;
    var upIcon = mx.controls.SimpleButton.prototype.fui;
    var downIcon = mx.controls.SimpleButton.prototype.fdi;
    var disabledIcon = mx.controls.SimpleButton.prototype.dfi;
    var initializing = true;
    var idNames = ["fus", "fds", "frs", "dfs", "tus", "tds", "trs", "dts", "fui", "fdi", "fri", "dfi", "tui", "tdi", "tri", "dti"];
    var stateNames = ["falseUp", "falseDown", "falseOver", "falseDisabled", "trueUp", "trueDown", "trueOver", "trueDisabled"];
    var refNames = ["upSkin", "downSkin", "rolloverSkin", "disabledSkin"];
    var tagMap = {falseUpSkin: 0, falseDownSkin: 1, falseOverSkin: 2, falseDisabledSkin: 3, trueUpSkin: 4, trueDownSkin: 5, trueOverSkin: 6, trueDisabledSkin: 7, falseUpIcon: 0, falseDownIcon: 1, falseOverIcon: 2, falseDisabledIcon: 3, trueUpIcon: 4, trueDownIcon: 5, trueOverIcon: 6, trueDisabledIcon: 7};
} // End of Class

⌨️ 快捷键说明

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