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

📄 window.as

📁 flash 仿VISTA windows 效果 源码
💻 AS
📖 第 1 页 / 共 2 页
字号:
function loadClip()
{
   // _root.Hourglass.show();
    fullClipName = clipName;
    paramLine = clipName.split("?")[1];
    clipName = clipName.split("?")[0];
    this.parameters = paramLine.split("&");
    tmp = clipName.split(".");
    this.extension = tmp[tmp.length - 1].toUpperCase();
    if (clipName.indexOf("folder:") <= -1)
    {
        if (clipName.indexOf(".") < 0)
        {
            LI._visible = Bar._visible = 0;
            this.attachMovie(clipName, "Clip", depth_content);
            this.timer_load = setInterval(this, "loadCheck_SWF", 10);
			
        } // end if
		
    }
    else
    {   
        LI._visible = Bar._visible = 0;
        Clip.attachMovie("folderwindow");
        //Clip.folder = clipName.split("folder:")[1].split(",")[0];
        //Clip.filter = clipName.split(",")[1].split("=")[1];
       // this.timer_load = setInterval(this, "loadCheck_SWF",10);
	   loaded_SWF();
    } // end if
    if (!(extension == "SWF" || extension == "JPG" || extension == "JPEG"))
    {
        if (extension == "XML")
        {
            this.myXML = new XML();
            this.myXML.load(clipName);
            this.timer_load = setInterval(this, "loadCheck_XML", 150);
        } // end if
    }
    else
    {
        interval = extension != "SWF" ? (25) : (150);
        Clip.loadMovie(fullClipName);
		//trace(clipName);
        this.timer_load = setInterval(this, "loadCheck_SWF",10);
    } // end if
} // End of the function
function loadCheck_SWF()
{
    Clip._visible = false;
    percent = int(Clip.getBytesLoaded() / (Clip.getBytesTotal() / 100));
    Bar.gotoAndStop(percent);
    if (percent >= 99 && Clip.win_width)
    {
        if (this.t != undefined)
        {
            if (int(getTimer() / 100) - this.t > 2)
            {
                loaded_SWF();
            } // end if
        }
        else
        {
            this.t = int(getTimer() / 100);
        } // end if
    } // end if
} // End of the function
function loadCheck_XML()
{
    percent = int(this.myXML.getBytesLoaded() / (this.myXML.getBytesTotal() / 100));
    Bar.gotoAndStop(percent);
    if (this.myXML.loaded)
    {
        loaded_XML();
    } // end if
} // End of the function
function loadCheck_LIB()
{
} // End of the function
function loadCheck_JPG()
{trace("kdsajfk");
	configureWindow();
} // End of the function
function loaded_SWF()
{
   // _root.Hourglass.hide();
    clearInterval(this.timer_load);
    this.closeable = Clip.closeable != undefined ? (Clip.closeable) : (true);
    this.minimizable = Clip.minimizable != undefined ? (Clip.minimizable) : (true);
    this.resizable = Clip.resizable != undefined ? (Clip.resizable) : (true);
    this.draggable = Clip.draggable != undefined ? (Clip.draggable) : (true);
    this.windowTitle = Clip.windowTitle != undefined ? (Clip.windowTitle) : (Globals.Settings.wintitle_default);
    this.windowTitle = Globals.Settings.wintitle_uppercase == "Yes" ? (this.windowTitle.toUpperCase()) : (this.windowTitle);
    this.windowIcon = Clip.windowIcon != undefined ? (Clip.windowIcon) : (Number(Globals.Settings.winicon_default));
    if (extension == "JPG" || extension == "JPEG")
    {
        this.windowIcon = 20;
    } // end if
    this.Icon.gotoAndStop(this.windowIcon);
    Clip.file=file;
	Clip.objID=objID;
	Clip.startID=startID;
	Clip.captions=captions;
    configureWindow();
    Clip._visible = true;
    Clip.gotoAndPlay(2);
} // End of the function
function loaded_XML()
{
    _root.Hourglass.hide();
    clearInterval(this.timer_load);
    this.XMLObj = this.myXML.buildObject();
    delete this.myXML;
    this.closeable = XMLObj.Options.closeable == "Yes" ? (true) : (false);
    this.minimizable = XMLObj.Options.minimizable == "Yes" ? (true) : (false);
    this.resizable = XMLObj.Options.resizable == "Yes" ? (true) : (false);
    this.draggable = XMLObj.Options.draggable == "Yes" ? (true) : (false);
    this.windowTitle = XMLObj.Options.windowTitle != "" ? (XMLObj.Options.windowTitle) : (Globals.Settings.wintitle_default);
    this.windowTitle = Globals.Settings.wintitle_uppercase == "Yes" ? (XMLObj.Options.windowTitle.toUpperCase()) : (XMLObj.Options.windowTitle);
    this.windowIcon = XMLObj.Options.icon != undefined ? (XMLObj.Options.icon) : (41);
    this.Icon.gotoAndStop(this.windowIcon);
    w = XMLObj.Options.width;
    h = XMLObj.Options.height;
    if (XMLObj.Options.bg_icon != "")
    {
        Clip.attachMovie("skin_icons", "BG", 1);
        Clip.BG.gotoAndStop(XMLObj.Options.bg_icon);
        if (w >= h)
        {
            if (h < w)
            {
                Clip.BG._height = h;
                Clip.BG._xscale = Clip.BG._yscale;
            } // end if
        }
        else
        {
            Clip.BG._width = w;
            Clip.BG._yscale = Clip.BG._xscale;
        } // end if
        Clip.BG._x = (w - Clip.BG._width) / 2;
        Clip.BG._y = (h - Clip.BG._height) / 2;
        Clip.BG._alpha = 12;
    } // end if
    this.TextStyle = new TextFormat();
    this.TextStyle.font = XMLObj.Options.font_face;
    this.TextStyle.size = XMLObj.Options.font_size;
    this.TextStyle.color = "0x" + XMLObj.Options.font_color;
    this.TextStyle.bold = XMLObj.Options.font_bold == "Yes" ? (true) : (false);
    this.TextStyle.align = XMLObj.Options.text_align;
    this.TextStyle.leftMargin = 5;
    Clip.createTextField("Textbox", 2, 0, 0, w, h);
    Clip.Textbox.autoSize = "none";
    Clip.Textbox.background = length(XMLObj.Options.bgcolor) == 6 ? (true) : (false);
    Clip.Textbox.backgroundColor = "0x" + XMLObj.Options.bgcolor;
    Clip.Textbox.selectable = false;
    txt = XMLObj.Text._value + "\n\n";
    Clip.Textbox.text = substring(txt, 2, length(txt));
    Clip.Textbox.setTextFormat(TextStyle);
    Clip.Textbox.makeTextbox(TextStyle);
    delete XMLObj;
    configureWindow();
} // End of the function
function configureWindow()
{
    Clip.Window = this;
    for (j = 0; j < this.parameters.length; j++)
    {
        tmp = parameters[j].split("=");
        Clip[tmp[0]] = tmp[1];
    } // end of for
    if (clipName != "messagebox")
    {
        _root.playSound("windowOpen");
    } // end if
    if (!closeable)
    {
        Buttons.IconC._alpha = 32;
        Buttons.C.enabled = false;
    } // end if
    if (!minimizable)
    {
        Buttons.IconM._alpha = 32;
        Buttons.M.enabled = false;
    } // end if
    RI._visible = resizable;
    setTitle();
    removeMovieClip(LI);
    removeMovieClip(Bar);
	Clip.win_width=Clip.win_width==undefined ? 0 : Clip.win_width;
	Clip.win_height=Clip.win_height==undefined ? 0 : Clip.win_height;
    if (Clip.win_width < min_width)
    {
        Clip.win_width = min_width;
    } // end if
    if (Clip.win_height < min_height)
    {
        Clip.win_height = min_height;
    } // end if
    arrange(true);
    if (_x < 0)
    {
        _x = _x + Math.abs(_x);
    } // end if
    if (_y < 0)
    {
        _y = _y + Math.abs(_y);
    } // end if
    if (Globals.screenWidth < _x + Clip.win_width)
    {
        _x = _x - (_x + Clip.win_width - Globals.screenWidth);
    } // end if
    if (Globals.screenHeight < _y + Clip.win_height)
    {
        _y = _y - (_y + _height - Globals.screenHeight);
    } // end if
    _parent.Taskbar.update();
    this.MyTaskButton.flash(50, 2);
    focus();
} // End of the function
function notify()
{
    _root.playSound("notify");
    //Skin.flash(30, 1);
    this.focus();
} // End of the function
function shake(radius)
{
    if (lx && ly)
    {
        this._x = lx;
        this._y = ly;
    } // end if
    this.slx = _x;
    this.sly = _y;
    this.radius = radius == undefined ? (20) : (radius);
    clearInterval(this.timer_shake);
    this.func_shake = function ()
    {
        this._x = int(this.slx - this.radius / 2 + int(Math.random() * this.radius));
        this._y = int(this.sly - this.radius / 2 + int(Math.random() * this.radius));
        this.radius = this.radius - this.radius / 8;
        if (this.radius < 1)
        {
            this._x = this.slx;
            this._y = this.sly;
            clearInterval(this.timer_shake);
        } // end if
    };
    this.timer_shake = setInterval(this, "func_shake", 10);
} // End of the function
function resizeTo(w, h, center)
{
    this.sow = this._width;
    this.soh = this._height;
    this.Clip.win_width = w < min_width ? (min_width) : (w);
    this.Clip.win_height = h < min_height ? (min_height) : (h);
    this.arrange();
    if (center)
    {
        _x = _x + (this.sow - this._width) / 2;
        _y = _y + (this.soh - this._height) / 2;
    } // end if
} // End of the function
function smoothResizeTo(w, h, s, center)
{
    this.sox = this._x;
    this.soy = this._y;
    this.sow = this.Clip.win_width;
    this.soh = this.Clip.win_height;
    this.snw = w < min_width ? (min_width) : (w);
    this.snh = h < min_height ? (min_height) : (h);
    this.ssp = s == undefined ? (5) : (s);
    this.center = center;
    clearInterval(this.timer_sResize);
    this.func_sResize = function ()
    {
        done = true;
        if (this.snw + this.ssp >= this.Clip.win_width)
        {
            if (this.Clip.win_width < this.snw - this.ssp)
            {
                done = false;
                this.Clip.win_width = this.Clip.win_width + this.ssp;
            } // end if
        }
        else
        {
            done = false;
            this.Clip.win_width = this.Clip.win_width - this.ssp;
        } // end if
        if (this.snh + this.ssp >= this.Clip.win_height)
        {
            if (this.Clip.win_height < this.snw - this.ssp)
            {
                done = false;
                this.Clip.win_height = this.Clip.win_height + this.ssp;
            } // end if
        }
        else
        {
            done = false;
            this.Clip.win_height = this.Clip.win_height - this.ssp;
        } // end if
        if (done)
        {
            this.Clip.win_width = this.snw;
            this.Clip.win_height = this.snh;
            clearInterval(this.timer_sResize);
        } // end if
        this.arrange();
        if (this.center)
        {
            this._x = this.sox + (this.sow - this.Clip.win_width) / 2;
            this._y = this.soy + (this.soh - this.Clip.win_height) / 2;
        } // end if
    };
    this.timer_sResize = setInterval(this, "func_sResize", 10);
} // End of the function
function create()
{
   // createEmptyMovieClip("Shadow", depth_shadow);
   // Shadow._visible = Globals.Settings.shadows == "Yes" ? (true) : (false);
    //Shadow._alpha = Number(Globals.CurrentScheme.shadow_alpha);
    createEmptyMovieClip("Skin", depth_skin);
    Skin.attachMovie("skin_windows", "BG", 1);
    Skin.BG._alpha = Globals.Settings.windows_transparency;
    Skin.attachMovie("skin_windows", "TL", 2);
    Skin.attachMovie("skin_windows", "TM", 3);
    attachMovie("winbuttom", "TR", 50);
	Skin.attachMovie("skin_windows", "TR", 4);
    Skin.attachMovie("skin_windows", "BL", 5);
    Skin.attachMovie("skin_windows", "BM", 6);
    Skin.attachMovie("skin_windows", "BR", 7);
	Skin.attachMovie("skin_windows", "L", 8);
	Skin.attachMovie("skin_windows", "R", 9);
	Skin._alpha = Number(Globals.CurrentScheme.window_alpha);

    attachMovie("skin_window_status", "Bar", depth_status);
    Bar.stop();
    attachMovie("skin_window_icon_loading", "LI", depth_load_icon);
    if (min_width < LI._width)
    {
        LI._width = min_width - 5;
        LI._yscale = LI._xscale;
    } // end if
    if (min_height < LI._height)
    {
        LI._height = min_height - 5;
        LI._xscale = LI._yscale;
    } // end if
    LI._x = min_width / 2-20;
    LI._y = min_height / 2-30;

    createEmptyMovieClip("Title", depth_title);
    Title.createTextField("T1", 2, 0, 0, 10, 10);
    Title.createTextField("T2", 1, 1, 1, 10, 10);
    Title.T1.selectable = Title.T2.selectable = false;
    Title.T1.text = Title.T2.text = Globals.CurrentLanguage.wintitle_loading;
    Title.T1.setTextFormat(Globals.TextStyle_WTitle1);
    Title.T2.setTextFormat(Globals.TextStyle_WTitle2);
    Title._x = Skin.TL._width + Number(Globals.Settings.wintitle_offset_x);
    Title._y = Number(Globals.Settings.wintitle_offset_y);
    Title.onPress = function ()
    {
        if (!(this.lastTime && int(getTimer() / 10) - this.lastTime < 30))
        {
            this._parent.focus();
            this._parent.dragStart();
            this.lastTime = int(getTimer() / 10);
        }
        else
        {
            //this._parent.minimize();
			this._parent.maxsize();
        } // end if
    };
    Title.onRelease = Title.onReleaseOutside = function ()
    {
        if (this._parent.dragging)
        {
            this._parent.dragStop();
        } // end if
    };
    attachMovie("skin_icons", "Icon", depth_icon);
    Icon._x = Number(Globals.Settings.winicon_offset_x);
    Icon._y = Number(Globals.Settings.winicon_offset_y);
    Icon.gotoAndStop(5);
    Icon._xscale = Icon._yscale =40;
    Icon.onPress = function ()
    {
        if (!(this.lastTime && int(getTimer() / 10) - this.lastTime < 30))
        {
            this._parent.focus();
            this.lastTime = int(getTimer() / 10);
        }
        else
        {
            this._parent.remove();
        } // end if
    };

	 Skin.R.onRollOver =Skin.L.onRollOver = function ()
    {
        _root.showTooltip(Globals.CurrentLanguage.text_resize);
		_root.changemouse(11);

    };
	Skin.BM.onRollOver = function (){ 
	_root.showTooltip(Globals.CurrentLanguage.text_resize);
		_root.changemouse(13);
		};
    Skin.R.onRollOut =Skin.L.onRollOut = Skin.BM.onRollOut=function ()
    {
        _root.hideTooltip();
_root.Nochangemouse();
    };
	
	
	
	Skin.R.onPress = function ()
    {	
        this._parent._parent.resizeStart(this,"R");
    };
    Skin.R.onRelease = Skin.R.onReleaseOutside = function ()
    {
        this._parent._parent.resizeStop();
    };
	Skin.L.onPress = function ()
    {
        this._parent._parent.resizeStart(this,"L");
    };
    Skin.L.onRelease = Skin.L.onReleaseOutside = function ()
    {
        this._parent._parent.resizeStop();
    };
	Skin.BM.onPress = function ()
    {
        this._parent._parent.resizeStart(this,"BM");
    };
    Skin.BM.onRelease = Skin.BM.onReleaseOutside = function ()
    {
        this._parent._parent.resizeStop();
    };
		Skin.BL.onPress = function ()
    {
        this._parent._parent.resizeStart(this,"BL");
    };
    Skin.BL.onRelease = Skin.BL.onReleaseOutside = function ()
    {	_root.cursor_mc._x = _root._xmouse;
    _root.cursor_mc._y = _root._ymouse;
        this._parent._parent.resizeStop();
    };
	
		Skin.BL.onPress = function ()

⌨️ 快捷键说明

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