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

📄 command.as

📁 flash 仿VISTA windows 效果 源码
💻 AS
📖 第 1 页 / 共 2 页
字号:
	                iconX = im;
	                iconY = Globals.Icons.icon_align == "Top" ? (iconY + is) : (iconY - is);
	            } // end if
	        }
	        else
	        {
	            iconY = Globals.Icons.icon_align == "Top" ? (is) : (Stage.height-80 - im);
	            iconX = im;
	        } // end if
	    }
	    else if (numIcons != 1)
	    {
	        iconY = iconY + is;
	        if (Stage.height-80 - im < iconY)
	        {
	            iconY = im;
	            iconX = Globals.Icons.icon_align == "Left" ? (iconX + is) : (iconX - is);
	        } // end if
	    }
	    else
	    {
	        iconX = Globals.Icons.icon_align == "Left" ? (im) : (640 - im);
	        iconY = im;
	    } // end if
	    Clip._x = Math.floor(iconX / ra) * ra;
	    Clip._y = Math.floor(iconY / ra) * ra;
	*/
	Clip.onRollOver = function() {
		_root.showTooltip(caption);
	};
	Clip.onRollOut = function() {
		_root.hideTooltip();
	};
	Clip.onDragOut = function() {
		_root.hideTooltip();
	};
	Clip.onRelease = Clip.onReleaseOutside=function () {
		if (this.onMouseMove != undefined) {
			this.swapDepths(this.oldDepth);
			this._alpha = 100;
			this._x = Math.floor(this._x/this.ra)*this.ra;
			this._y = Math.floor(this._y/this.ra)*this.ra;
			this.onMouseMove = undefined;
		}
		// end if  
	};
	Clip.onPress = function() {
		_root.hideTooltip();
		_root.playSound("buttonClick");
		this.Caption.setTextFormat(this.Style_Sel);
		if (!(this.lastTime && int(getTimer()/10)-this.lastTime<30)) {
			this.lastTime = int(getTimer()/10);
		} else {
			//this.flash(150, 3);
			_root.openLink(link);
		}
		// end if
		this.onMouseDown = function() {
			if (!this.hitTest(_root._xmouse, _root._ymouse, true)) {
				this.Caption.setTextFormat(this.Style_Nrm);
				this.onMouseDown = undefined;
			}
			// end if  
		};
		if (Globals.Icons.draggable != "Yes") {
			return (undefined);
		}
		// end if  
		this.oldDepth = this.getDepth();
		this.swapDepths(_root.depth_icondrag);
		this._alpha = this._alpha/2.500000;
		this.offx = this._xmouse;
		this.offy = this._ymouse;
		this.onMouseMove = function() {
			this._x = _root._xmouse-this.offx;
			this._y = _root._ymouse-this.offy;
			updateAfterEvent();
		};
	};
}
// End of the function
function loadClip(fileName, x, y) {
	this.createEmptyMovieClip("Clip"+depth_clips, depth_clips);
	Clip = this["Clip"+depth_clips];
	Clip._x = x;
	Clip._y = y;
	Clip.loadmovie(Globals.clipPath+fileName);
	Clip.onEnterFrame = function() {
		this._visible = 0;
		if (this.getBytesLoaded()>=this.getBytesTotal()) {
			this._visible = 1;
			this.onEnterFrame = undefined;
		}
		// end if  
	};
	depth_clips++;
}
// End of the function
function showOutline(Obj) {
	if (Globals.Settings.show_window_outlines != "Yes") {
		return (undefined);
	}
	// end if  
	isWindow = Obj.Skin ? (true) : (false);
	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;
	createEmptyMovieClip("Outline", depth_outline);
	Outline.lineStyle(0, "0x999999", 100);
	Outline.moveTo(w*-1/2, h*-1/2);
	Outline.lineTo(w/2, h*-1/2);
	Outline.lineTo(w/2, h/2);
	Outline.lineTo(w*-1/2, h/2);
	Outline.lineTo(w*-1/2, h*-1/2);
	Outline._x = x+w/2;
	Outline._y = y+h/2;
	Outline.flash(20, 999);
}
// End of the function
function hideOutline() {
	removeMovieClip(this.Outline);
}
// End of the function
function openLink(link, Opener) {
	if (link == "" || link == "-") {
		return (undefined);
	}
	// end if  
	temp = link.split(",");
	link_type = link.split(":")[0];
	if (link_type == "languages") {
		temp = link.split("languages:")[1].split("(");
		for (i=1; i<temp.length; i++) {
			link_lang = temp[i].split(")")[0];
			link_url = temp[i].split(")")[1];
			if (link_lang == Globals.CurrentLanguage.id) {
				openLink(link_url, Opener);
				return (undefined);
			}
			// end if  
		}
		// end of for
		return (undefined);
	}
	// end if  
	if (link_type != "function") {
		if (link_type != "popup") {
			if (!(link_type == "window" || link_type == "folder" || link.toUpperCase().indexOf(".JPG")>-1)) {
				if (link_type != "flashwindow") {
					if (link.indexOf(":")<0) {
						if (link.indexOf(".")>-1 && link.indexOf(".swf")<0 && link.indexOf(".mp3")<0 && link.indexOf(".snd")<0) {
							//trace(link);
							getURL(link, "_blank");
							return (undefined);
						}
						// end if  
						this.createEmptyMovieClip("Clip"+depth_clips, depth_clips);
						Clip = this["Clip"+depth_clips];
						Clip.x = temp[1].split("=")[1];
						Clip.y = temp[2].split("=")[1];
						Clip.w = temp[3].split("=")[1];
						Clip.h = temp[4].split("=")[1];
						if (temp[0].indexOf(".")>=0) {
							if (!(link.indexOf(".snd")>-1 || link.indexOf(".mp3")>-1)) {
								Clip.createEmptyMovieClip("Container", 1);
								Clip.Container.loadmovie(temp[0]);
								Clip.onEnterFrame = function() {
									if (this.Container.getBytesLoaded()<this.Container.getBytesTotal()) {
										this._visible = 0;
										this.Container.stop();
									} else {
										this._x = this.x;
										this._y = this.y;
										if (this.w) {
											this._width = this.w;
										}
										// end if  
										if (this.h) {
											this._height = this.h;
										}
										// end if  
										this._visible = 1;
										this.Container.play();
										this.onEnterFrame = undefined;
									}
									// end if
								};
							} else {
								this.SoundFile = new Sound();
								this.SoundFile.loadSound(link, true);
							}
							// end if
						} else {
							Clip.attachMovie(temp[0], "Container", 1);
						}
						// end if
						depth_clips++;
					}
					// end if  
				} else {
					file = temp[0].split("flashwindow:")[1];
					flashWindow(file);
				}
				// end if
			} else {
				file = link_type == "window" ? (temp[0].split("window:")[1]) : (link);
				x = temp[1].split("=")[1];
				y = temp[2].split("=")[1];
				newWindow(file, x, y);
			}
			// end if
		} else {
			this.popup_width = 640;
			this.popup_height = 480;
			this.popup_name = "Win";
			this.popup_toolbar = "no";
			this.popup_location = "no";
			this.popup_directories = "no";
			this.popup_status = "no";
			this.popup_menubar = "no";
			this.popup_scrollbars = "no";
			this.popup_resizable = "no";
			this.popup_copyhistory = "no";
			page = temp[0].split("popup:")[1];
			for (i=1; i<temp.length; i++) {
				this["popup_"+temp[i].split("=")[0]] = temp[i].split("=")[1];
			}
			// end of for
			this.popup_left = (System.capabilities.screenResolutionX-this.popup_width)/2;
			this.popup_top = (System.capabilities.screenResolutionY-(Number(this.popup_height)+50))/2;
			getURL("Javascript: "+Globals.popupName+"=window.open("+"\""+page+"\""+","+"\""+popup_name+"\""+","+"\""+"toolbar="+popup_toolbar+",left="+popup_left+",top="+popup_top+",width="+popup_width+",height="+popup_height+",directories="+popup_directories+",status="+popup_status+",scrollbars="+popup_scrollbars+",resizable="+popup_resizable+",menubar="+popup_menubar+",location="+popup_location+",copyhistory="+popup_copyhistory+"\""+"); PopWin.focus();", "");
			attachMovie("popup_control", "PopupControl", depth_popupControl);
		}
		// end if
	} else {
		Clip = temp[0].split(":")[1] == "window" ? (Opener) : (this);
		func = temp[1].split("(")[0];
		pars = link.split("(")[1].split(")")[0].split(",");
		Clip[func](pars[0], pars[1], pars[2], pars[3], pars[4], pars[5]);
	}
	// end if
}
// End of the function
function setLanguage() {
	Globals.language = _root.language=_root.lang=Globals.Languages.id;
	Globals.CurrentLanguage = Globals.Languages;
}
// End of the function
function setScheme() {
	Globals.CurrentScheme = Globals.Scheme;
	Globals.TextStyle_Nrm = new TextFormat();
	Globals.TextStyle_Nrm.font = Globals.CurrentScheme.font_face;
	Globals.TextStyle_Nrm.size = Globals.CurrentScheme.font_size;
	Globals.TextStyle_Nrm.color = "0x"+Globals.CurrentScheme.font_color;
	Globals.TextStyle_Nrm.bold = Globals.CurrentScheme.font_bold == "Yes" ? (true) : (false);
	Globals.TextStyle_Sel = new TextFormat();
	Globals.TextStyle_Sel.font = Globals.CurrentScheme.font_face;
	Globals.TextStyle_Sel.size = Globals.CurrentScheme.font_size;
	Globals.TextStyle_Sel.color = "0x"+Globals.CurrentScheme.font_selected;
	Globals.TextStyle_Sel.bold = false;
	Globals.TextStyle_Dis = new TextFormat();
	Globals.TextStyle_Dis.font = Globals.CurrentScheme.font_face;
	Globals.TextStyle_Dis.size = Globals.CurrentScheme.font_size;
	Globals.TextStyle_Dis.color = "0x"+Globals.CurrentScheme.font_disabled;
	Globals.TextStyle_Dis.bold = Globals.CurrentScheme.font_bold == "Yes" ? (true) : (false);
	Globals.TextStyle_WTitle1 = new TextFormat();
	Globals.TextStyle_WTitle1.font = Globals.CurrentScheme.font_face;
	Globals.TextStyle_WTitle1.size = Globals.CurrentScheme.wintitle_font_size;
	Globals.TextStyle_WTitle1.color = "0x"+Globals.CurrentScheme.wintitle_color_light;
	Globals.TextStyle_WTitle1.bold = true;
	Globals.TextStyle_WTitle2 = Globals.TextStyle_WTitle1.copy();
	Globals.TextStyle_WTitle2.color = "0x"+Globals.CurrentScheme.wintitle_color_dark;
	Globals.TextStyle_Tooltip = new TextFormat();
	Globals.TextStyle_Tooltip.font = Globals.CurrentScheme.tooltip_font;
	Globals.TextStyle_Tooltip.size = Globals.CurrentScheme.tooltip_fontsize;
	Globals.TextStyle_Tooltip.color = Globals.CurrentScheme.tooltip_fontcolor;
	Globals.TextStyle_Tooltip.leftMargin = 2;
	Startmenu.create();
}
// End of the function
function setSkins(num) {
	Globals.currentSkin = num;
	for (i=1; i<winList.length; i++) {
		this[winList[i]].setSkin();
	}
	// end of for
}
// End of the function
function setShadows() {
	for (i=1; i<winList.length; i++) {
		this[winList[i]].Shadow._visible = Globals.Settings.shadows == "Yes" ? (true) : (false);
	}
	// end of for
}
// End of the function
function setTransparencies() {
	for (i=1; i<winList.length; i++) {
		this[winList[i]].Skin.BG._alpha = Number(Globals.Settings.windows_transparency);
		this[winList[i]].Menu._alpha = Number(Globals.Menu.transparency);
	}
	// end of for
	Startmenu._alpha = Number(Globals.Menu.transparency);
}
// End of the function
function playSound(name) {
	_root["Snd_"+name].stop();
	_root["Snd_"+name].start();
}
// End of the function
function getFileIcon(fileName) {
	extension = fileName.split(".")[1].toUpperCase();
	//trace(extension);
	if (extension == undefined) {
		return (1);
	}
	// end if  
	temp = new Array();
	temp[0] = [20, "JPG", "JPEG", "GIF", "BMP", "IMG", "PNG", "PSD", "PSP", "ICO", "IFF", "MAC", "PIC", "TIF", "TIFF", "TGA", "PCX"];
	temp[1] = [27, "SND", "AU", "WAV", "MP3", "MP2", "VOC", "MID", "MOD", "IDI", "AIF", "AIFF", "WMA", "WAX", "MUS"];
	temp[2] = [23, "SWF", "FLA"];
	temp[3] = [43, "AVI", "MOV", "MPG", "MPEG", "WMV", "WVX", "ASF", "ASX", "WMD", "WMS", "RAM"];
	temp[4] = [6, "HTM", "HTML", "JS", "XML", "PHP", "PHP3", "CGI", "ASP"];
	temp[5] = [42, "ZIP", "RAR", "ACE", "CAB", "TGZ", "TAR"];
	temp[6] = [13, "TXT", "TEXT", "INI"];
	for (i=0; i<temp.length; i++) {
		for (j=1; j<temp[i].length; j++) {
			if (extension == temp[i][j]) {
				return (temp[i][0]);
			}
			// end if  
		}
		// end of for
	}
	// end of for
	return (3);
}
// End of the function
_root.soundVolume = 100;
setLanguage();
setScheme();
Globals.currentSkin = Number(Globals.Settings.default_skin);
for (i=0; Globals.Icons.Item[i]; i++) {
	addIcon(Globals.Icons.Item[i].caption, Globals.Icons.Item[i].icon, Globals.Icons.Item[i].link);
}
// end of for
Startmenu.swapDepths(depth_menu);
Taskbar.swapDepths(depth_taskbar);
DesktopColor = new Color(BGColor);
DesktopColor.setRGB("0x"+Globals.CurrentScheme.desktop_color);
//Wallpaper._visible = true;
//this.attachMovie("hourglass", "Hourglass", depth_hourglass);
this.onEnterFrame = function() {
	this.onEnterFrame = undefined;
	k = Globals.Settings.startup_files.split("|");
	for (j=0; j<k.length; j++) {
		_root.openLink(k[j]);
	}
	// end of for
};
stop();
 function ChangeMaxSizeWindow() {
	for (i=1; i<winList.length; i++) {
		if(this[winList[i]].maxsized==true){
			this[winList[i]].maxsized=false;
		this[winList[i]].maxsize(true)}
		else
		{
			this[winList[i]].dragging222();
		}
	}
	// end of for
}
reloadIcon();

⌨️ 快捷键说明

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