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

📄 command.as

📁 flash 仿VISTA windows 效果 源码
💻 AS
📖 第 1 页 / 共 2 页
字号:
numIcons = 0;
winCount = 0;
function newWindow(clipName, x, y) {
	if (Globals.Settings.single_instances == "Yes") {
		for (i=1; winList.length>=i; i++) {
			if (this[winList[i]].fullClipName == clipName) {
				this[winList[i]].notify();
				return (undefined);
			}
			// end if  
		}
		// end of for
	}
	// end if  
	winCount++;
	winName = winCount<10 ? ("Win0"+winCount) : ("Win"+winCount);
	winList.push(winName);
	attachMovie("exp_window", winName, depth_windows+winCount);
	Windows = this[winName];
	Windows.clipName = clipName;
	//Windows.create();
	Windows.listNumber = winList.length-1;
	Windows.centerX = x == "" || x == undefined ? (true) : (false);
	Windows.centerY = y == "" || y == undefined ? (true) : (false);
	Windows._visible = 0;
	Windows._x = x;
	Windows._y = y;
	return (Windows);
}
// End of the function
function flashWindow(clipName) {
	if (Globals.Settings.single_instances == "Yes") {
		for (i=1; winList.length>=i; i++) {
			if (this[winList[i]].fullClipName == clipName) {
				this[winList[i]].notify();
				return (undefined);
			}
			// end if  
		}
		// end of for
	}
	// end if  
	winCount++;
	winName = winCount<10 ? ("Win0"+winCount) : ("Win"+winCount);
	winList.push(winName);
	attachMovie("flash_window", winName, depth_windows+winCount);
	Window = this[winName];
	Window.clipName = clipName;
	Window.listNumber = winList.length-1;
	Window.centerX = x == "" || x == undefined ? (true) : (false);
	Window.centerY = y == "" || y == undefined ? (true) : (false);
	Window._visible = 0;
	Window._x = x;
	Window._y = y;
	return (Window);
}
// End of the function
function removeWindow(Windows) {
	num = Windows.listNumber;
	winList.splice(num, 1);
	for (i=num; i<winList.length; i++) {
		this[winList[i]].listNumber--;
	}
	// end of for
	removeMovieClip(Windows);
	if (!this[winList[winList.length-1]].minimized) {
		this[winList[winList.length-1]].focus();
	}
	// end if  
	if (window.Title.T1.text == Globals.Settings.oldtitle) {
		stopAllSounds();
	}
	// end if  
}
// End of the function
function removeAll() {
	for (i=1; i<winList.length; i++) {
		closeEffect(this[winList[i]]);
		removeMovieClip(this[winList[i]]);
	}
	// end of for
	winList = new Array("0");
	stopAllSounds();
}
// End of the function
function minimizeAll() {
	for (i=1; i<winList.length; i++) {
		this[winList[i]].minimize();
	}
	// end of for
}
// End of the function
function minMaxEffect(Windows, TaskButton) {
	Windows.dragging222();
	if (Globals.Settings.minimize_effect != "Yes") {
		return (undefined);
	}
	// end if  
	if (!Windows.minimized) {
		Windows._visible = false;
		w2 = Windows.Skin._width;
		h2 = Windows.Skin._height;
		x2 = Windows._x;
		y2 = Windows._y-Windows.Skin.TL._height;
		w1 = TaskButton._width;
		h1 = TaskButton._height;
		x1 = Taskbar.Buttonbar._x+TaskButton._x;
		y1 = Taskbar._y+TaskButton._y;
	} else {
		Windows._visible = false;
		w1 = Windows.Skin._width;
		h1 = Windows.Skin._height;
		x1 = Windows._x;
		y1 = Windows._y-Windows.Skin.TL._height;
		w2 = TaskButton._width;
		h2 = TaskButton._height;
		x2 = Taskbar.Buttonbar._x+TaskButton._x;
		y2 = Taskbar._y+TaskButton._y;
	}
	// end if
	depth_effects++;
	createEmptyMovieClip("FX"+depth_effects, depth_effects);
	Clip = this["FX"+depth_effects];
	Clip.lineStyle(0, "0x"+Globals.CurrentScheme.minimize_color, 100);
	Clip.beginFill("0x"+Globals.CurrentScheme.minimize_color, 32);
	Clip.lineTo(w1, 0);
	Clip.lineTo(w1, h1);
	Clip.lineTo(0, h1);
	Clip.lineTo(0, 0);
	Clip._x = x1;
	Clip._y = y1;
	dx = Math.round(x2-x1);
	dy = Math.round(y2-y1);
	Clip.xs = dx*Number(Globals.Settings.minimize_speed);
	Clip.ys = dy*Number(Globals.Settings.minimize_speed);
	xsteps = int(Math.abs((x1-x2)/Clip.xs));
	ysteps = int(Math.abs((y1-y2)/Clip.ys));
	Clip.max_steps = ysteps<xsteps ? (xsteps) : (ysteps);
	Clip.ws = (w1-w2)/Clip.max_steps;
	Clip.hs = (h1-h2)/Clip.max_steps;
	Clip.MyWindow = Windows;
	Clip.step = 0;
	Clip.onEnterFrame = function() {
		this._x = this._x+this.xs;
		this._y = this._y+this.ys;
		this._width = this._width-this.ws;
		this._height = this._height-this.hs;
		this.step++;
		if (this.step == this.max_steps) {
			if (!this.MyWindow.minimized) {
				
				
				this.MyWindow._visible = true;
				if (this.MyWindow.maxsized){
					this.MyWindow.maxsized=false;
					this.MyWindow.maxsize(true);}
			}
			// end if  
			this.onEnterFrame = undefined;
			removeMovieClip(this);
		}
	};
}
// End of the function
function closeEffect(Obj) {
	isWindow = Obj.Skin ? (true) : (false);
	if ((Globals.Settings.close_effect != "Yes" || isWindow) && Obj.minimized) {
		return (undefined);
	}
	// end if  
	w = isWindow ? (Obj.Skin._width) : (Obj._width);
	h = isWindow ? (Obj.Skin._height) : (Obj._height);
	y = isWindow ? (Obj._y-Obj.Skin.TL._height) : (Obj._y);
	x = Obj._x;
	_root.playSound("windowClose");
	depth_effects++;
	createEmptyMovieClip("FX"+depth_effects, depth_effects);
	Clip = this["FX"+depth_effects];
	Clip.lineStyle(0, "0x"+Globals.CurrentScheme.minimize_color, 100);
	Clip.beginFill("0x"+Globals.CurrentScheme.minimize_color, 32);
	Clip.moveTo(w*-1/2, h*-1/2);
	Clip.lineTo(w/2, h*-1/2);
	Clip.lineTo(w/2, h/2);
	Clip.lineTo(w*-1/2, h/2);
	Clip.lineTo(w*-1/2, h*-1/2);
	Clip._x = x+w/2;
	Clip._y = y+h/2;
	Clip.sp = Number(Globals.Settings.close_speed);
	Clip.onEnterFrame = function() {
		this._xscale = this._yscale=this._yscale-this.sp;
		if (this._yscale<this.sp) {
			this.onEnterFrame = undefined;
			removeMovieClip(this);
		}
		// end if  
	};
}
// End of the function
function hideTooltip() {
	removeMovieClip(Tooltip);
}
// End of the function
function showTooltip(txt) {
	clearInterval(Tooltip.timer_wait);
	createEmptyMovieClip("Tooltip", depth_tooltips);
	Tooltip._visible = 0;
	Tooltip.createTextField("Caption", 2, 0, 0, 10, 10);
	Tooltip.Caption.autoSize = "left";
	Tooltip.Caption.selectable = false;
	Tooltip.Caption.border = true;
	Tooltip.Caption.borderColor = "0x"+Globals.CurrentScheme.tooltip_bordercolor;
	Tooltip.Caption.background = true;
	Tooltip.Caption.backgroundColor = "0x"+Globals.CurrentScheme.tooltip_background;
	Tooltip.Caption.text = Globals.Settings.tooltip_uppercase == "Yes" ? (txt.toUpperCase()) : (txt);
	Tooltip.Caption.setTextFormat(Globals.TextStyle_Tooltip);
	w = Tooltip._width;
	h = Tooltip._height;
	Tooltip.createEmptyMovieClip("Shadow", 1);
	Tooltip.Shadow.lineStyle(2, "0x000000", Number(Globals.Settings.shadow_alpha)/3);
	Tooltip.Shadow.beginFill("0x000000", Number(Globals.Settings.shadow_alpha));
	Tooltip.Shadow.lineTo(w, 0);
	Tooltip.Shadow.lineTo(w, h);
	Tooltip.Shadow.lineTo(0, h);
	Tooltip.Shadow.lineTo(0, 0);
	Tooltip.Shadow.endFill();
	Tooltip.Shadow._x = Tooltip.Shadow._x+3;
	Tooltip.Shadow._y = Tooltip.Shadow._y+3;
	Tooltip.Shadow.t1 = int(getTimer()/1000);
	Tooltip._x = _xmouse-w/2;
	Tooltip._y = _ymouse+20;
	if (Globals.screenHeight<Tooltip._y+Tooltip._height) {
		Tooltip._y = _ymouse-Tooltip._height;
	}
	// end if  
	if (Globals.screenWidth<Tooltip._x+Tooltip._width) {
		Tooltip._x = Tooltip._x-(Tooltip._x+Tooltip._width-Globals.screenWidth);
	}
	// end if  
	Tooltip.Shadow.onEnterFrame = function() {
		if (!(int(getTimer()/1000)-this.t1 == Globals.Settings.tooltip_delay && !this._parent._visible)) {
			if (int(getTimer()/1000)-this.t1 == Globals.Settings.tooltip_duration) {
				_root.hideTooltip();
			}
			// end if  
		} else {
			this._parent.flash(50, 1);
			_root.playSound("tooltip");
			this._parent._visible = 1;
		}
		// end if
	};
}
// End of the function
function messageBox(msgType, msgButtons, msgText, msgFunc) {
	Windows = newWindow("messagebox");
	Windows.msgType = msgType;
	Windows.msgButtons = msgButtons;
	Windows.msgText = msgText;
	Windows.msgFunc = msgFunc;
}
// End of the function
function reloadIcon() {
	ra = Number(Globals.Icons.raster_size);
	is = Number(Globals.Icons.icon_spacing);
	im = Number(Globals.Icons.icon_margin);
	il = Number(Globals.Icons.icon_left);
	it = Number(Globals.Icons.icon_top);
	for (i=1; i<=numIcons; i++) {
		Clip = this["Icon"+i];
		Clip._visible=true;
		if (i != 1) {
			iconY = iconY+is;
			if (Stage.height-40-im<iconY) {
				iconY = it;
				iconX = Globals.Icons.icon_align == "Left" ? (iconX+is) : (iconX-is);
			}
			// end if  
		} else {
			iconX = Globals.Icons.icon_align == "Left" ? (il) : (Stage.width-il);
			iconY = it;
		}
		// end if
		Clip._x = Math.floor(iconX/ra)*ra;
		Clip._y = Math.floor(iconY/ra)*ra;
	}
	//end for
}
function showIcon(iss) {
	if(iss) {
		for (i=1; i<=numIcons; i++) {
			Clip = this["Icon"+i];
			Clip._visible=true;
		}
	}
		else
		{		for (i=1; i<=numIcons; i++) {
			Clip = this["Icon"+i];
			Clip._visible=false;
		}
		}
	
}
function addIcon(caption, icon, link,where) {
	if (where==undefined) 
	{
		where=this;
	}
	ra = Number(Globals.Icons.raster_size);
	is = Number(Globals.Icons.icon_spacing);
	im = Number(Globals.Icons.icon_margin);
	caption = caption.indexOf("text_")>-1 ? (Globals.CurrentLanguage[caption]) : (caption);
	where.numIcons++;
	where.createEmptyMovieClip("Icon"+numIcons, depth_icons+numIcons);
	Clip = where["Icon"+numIcons];
	Clip.ra = ra;
	Clip.attachMovie("skin_icons", "Icon", 2);
	Clip.Icon.gotoAndStop(icon);
	Clip.Icon._width = Globals.Icons.icon_size;
	Clip.Icon._height = Globals.Icons.icon_size;
	Clip.attachMovie("skin_icons", "Symbol", 3);
	Clip.Symbol.gotoAndStop(25);
	Clip.Symbol._width = Clip.Symbol._height=Clip.Icon._width/3;
	Clip.Symbol._y = Clip.Icon._height-Clip.Symbol._height;
	Clip.Symbol._visible = Globals.Icons.shortcut_symbols == "Yes" ? (1) : (0);
	Clip.attachMovie("skin_icons", "Shadow", 1);
	Clip.Shadow.gotoAndStop(icon);
	Clip.Shadow._width = Globals.Icons.icon_size;
	Clip.Shadow._height = Globals.Icons.icon_size;
	Clip.Shadow._x = Number(Globals.Icons.shadow_offset);
	Clip.Shadow._y = Number(Globals.Icons.shadow_offset);
	Clip.Shadow.Col = new Color(Clip.Shadow);
	Clip.Shadow.Col.setRGB("0x000000");
	Clip.Shadow._alpha = Number(Globals.CurrentScheme.shadow_alpha);
	Clip.Shadow._visible = Globals.Icons.icon_shadows == "Yes" ? (1) : (0);
	Clip.Style_Nrm = Globals.TextStyle_Nrm.copy();
	Clip.Style_Sel = Globals.TextStyle_Sel.copy();
	Clip.Style_Nrm.color = "0x"+Globals.Icons.fontcolor;
	Clip.Style_Sel.color = "0x"+Globals.Icons.fontcolor_selected;
	Clip.Style_Nrm.size = Clip.Style_Sel.size=Globals.CurrentScheme.GUI_font_size;
	Clip.Style_Nrm.align = Clip.Style_Sel.align="center";
	Clip.createTextField("Caption", 4, 0, 0, is*1.500000, is);
	Clip.createTextField("CaptionShadow", 3, 0, 0, is*1.500000, is);
	
	
	Clip.Caption.selectable = false;
	Clip.Caption.autoSize = "center";
	Clip.Caption.multiline = true;
	Clip.Caption.wordWrap = true;
	Clip.Caption.text = Globals.Icons.uppercase_captions == "Yes" ? (caption.toUpperCase()) : (caption);
	Clip.Caption.setTextFormat(Clip.Style_Nrm);
	Clip.Caption._x = Clip.Icon._x+Clip.Icon._width/2-Clip.Caption._width/2;
	Clip.Caption._y = Clip.Icon._height+3;
	
	
	Clip.CaptionShadow.selectable = false;
	Clip.CaptionShadow.autoSize = "center";
	Clip.CaptionShadow.multiline = true;
	Clip.CaptionShadow.wordWrap = true;
	Clip.CaptionShadow.text = Globals.Icons.uppercase_captions == "Yes" ? (caption.toUpperCase()) : (caption);
	Clip.Style_Nrm.color = "0xcccccc";
	Clip.CaptionShadow.setTextFormat(Clip.Style_Nrm);
	Clip.Style_Nrm.color = "0x"+Globals.Icons.fontcolor;
	//Clip.CaptionShadow.setRGB("0xeeeeee");
	Clip.CaptionShadow._x =Clip.Caption._x+1;
	Clip.CaptionShadow._y = Clip.Caption._y+1 ;
	Clip.CaptionShadow._alpha =50;
	/*
	 if (!(Globals.Icons.icon_align == "Left" || Globals.Icons.icon_align == "Right"))
	    {
	        if (numIcons != 1)
	        {
	            iconX = iconX + is;
	            if (Stage.width-80 - im < iconX)
	            {

⌨️ 快捷键说明

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