📄 aqualook.as
字号:
var x:Number = 0; var y:Number = 0; this.drawLine(mc, x, y, x + size - dX, y + size - dY, clr, alpha); this.drawLine(mc, x + dX, y, x + size - dX, y + size - 2*dY, clr, alpha); this.drawLine(mc, x, y + dY, x + size - 2*dX, y + size - dY, clr, alpha); this.drawLine(mc, x, y + size - dY, x + size2 - 2*dX, y + size2 + dY, clr, alpha); this.drawLine(mc, x + dX, y + size - dY, x + size2 - dX, y + size2 + dY, clr, alpha); this.drawLine(mc, x, y + size - 2*dY, x + size2 - 2*dX, y + size2, clr, alpha); this.drawLine(mc, x + size2 + dX, y + size2 - 2*dY, x + size - dX, y, clr, alpha); this.drawLine(mc, x + size2 + dX, y + size2 - dY, x + size - dX, y + dY, clr, alpha); this.drawLine(mc, x + size2, y + size2 - 2*dY, x + size - 2*dX, y, clr, alpha); mc._width = prop*nW; mc._height = prop*nH;}_global.AquaLook.prototype.drawComboBoxBtn = function(movie:MovieClip, nW:Number, nH:Number, data:Object):Void{ movie.clear(); var colors:Array = new Array(data.clr, 0xffffff); var alphas:Array = new Array(90, 90); var ratios:Array = new Array(0, 188); var matrix:Object = {matrixType:"box", x:0, y:0, w:nW, h:nH, r: 0}; movie.beginGradientFill("linear", colors, alphas, ratios, matrix); this.drawRoundRect(movie, 1.5, 1.5, nW - 1.5, nH - 1.5, 2); movie.endFill(); /* movie.createEmptyMovieClip('mc', 100); movie.mc._x = 0.1*nW; movie.mc._y = 0.1*nH; nW *= 0.8; nH *= 0.8; var colors:Array = new Array(0xffffff, 0xffffff, 0xffffff); var alphas:Array = new Array(50, 100, 50); var ratios:Array = new Array(0, 180, 255); var w:Number = nW * 4 / 11; var h:Number = nH / 3; var off:Number = 0; var matrix:Object = {matrixType:"box", x:1, y:off, w:w, h:nH - (1 - off), r:0}; movie.mc.beginGradientFill("linear", colors, alphas, ratios, matrix); movie.mc.moveTo(1, off); var obj:Object = this.drawArc(movie.mc, 1, off, w, -90, 90, h); var curX:Number = w + 1; var curY:Number = nH - h - (1 - off); movie.mc.lineTo(curX, curY); obj = this.drawArc(movie.mc, curX, curY, w, -90, 0, h); movie.mc.lineTo(1, off); movie.mc.endGradientFill(); //1) color of arrow 2) alpha movie.mc.beginFill(0, 80); w = nH / 3; h = nH / 5; movie.mc.moveTo(nW / 2, nH / 2 + h); movie.mc.lineTo(nW / 2 - w / 2, nH / 2 - h); movie.mc.lineTo(nW / 2 + w / 2, nH / 2 - h); movie.mc.lineTo(nW / 2, nH / 2 + h); movie.mc.endFill(); delete colors; delete alphas; delete ratios; delete matrix; */ /* movie.clear(); movie.beginFill(data.clr, 55); //35 this.drawRoundRect(movie, 1, 1, nW - 1, nH - 1, 2); movie.endFill(); */ var size:Number = Math.min(nW, nH) / 4; var cw:Number = nW / 2; var ch:Number = nH * 3 / 4; var halfSize:Number = size / 2; movie.beginFill(0, 80); movie.moveTo(); movie.moveTo(cw, ch + halfSize); movie.lineTo(cw - halfSize, ch - halfSize); movie.lineTo(cw + halfSize, ch - halfSize); movie.lineTo(cw, ch + halfSize); movie.endFill(); var ch:Number = nH / 4; movie.beginFill(0, 80); movie.moveTo(); movie.moveTo(cw, ch - halfSize); movie.lineTo(cw - halfSize, ch + halfSize); movie.lineTo(cw + halfSize, ch + halfSize); movie.lineTo(cw, ch - halfSize); movie.endFill();}_global.AquaLook.prototype.drawComboBox = function(movie:MovieClip, nW:Number, nH:Number, data:Object):Void{ movie.clear(); switch(data.mode) { default: movie.beginFill(globalStyleFormat[data.pLink._backgroundBorder], 100); this.drawRoundRect(movie, 0, 0, nW, nH, 3); movie.endFill(); var colors:Array = new Array(globalStyleFormat[data.pLink._backgroundBorder], data.clr); var alphas:Array = new Array(100, 100); var ratios:Array = new Array(0, 180); var matrix:Object = {matrixType:"box", x:1, y:1, w:nW - 2, h:nH - 2, r:Math.PI / 2}; movie.beginGradientFill("linear", colors, alphas, ratios, matrix); this.drawRoundRect(movie, 1, 1, nW - 1, nH - 1, 2); movie.endFill(); // highlight var colors:Array = new Array(data.clr, data.clr, data.clr); var alphas:Array = new Array(100, 50, 0); var ratios:Array = new Array(10, 110, 110); var matrix:Object = {matrixType:"box", x:1, y:1, w:nW - 2, h:nH - 2, r:Math.PI / 2}; movie.beginGradientFill("linear", colors, alphas, ratios, matrix); this.drawRoundRect(movie, 1, 1, nW - 1, nH - 1, 2); movie.endFill(); break; }}_global.AquaLook.prototype.drawRect = function(movie:MovieClip, nX:Number, nY:Number, nW:Number, nH:Number, nColor:Number, nAlpha:Number):Void{ if(!nColor) nColor = 0; if(nAlpha == undefined || nAlpha == null) nAlpha = 100; with(movie) { beginFill(nColor, nAlpha); moveTo(nX, nY); lineTo(nX + nW, nY); lineTo(nX + nW, nY + nH); lineTo(nX, nY + nH); lineTo(nX, nY); endFill(); }}_global.AquaLook.prototype.drawLine = function(movie:MovieClip, x1:Number, y1:Number, x2:Number, y2:Number, clr:Number, alpha:Number):Void{ var dx:Number = Math.abs(x2 - x1); var dy:Number = Math.abs(y2 - y1); var sx:Number = x2 >= x1 ? 1 : -1; var sy:Number = y2 >= y1 ? 1 : -1; this.drawRect(movie, x1, y1, 1, 1, clr, alpha); if(dy <= dx) { var d1:Number = dy << 1; var d:Number = d1 - dx; var d2:Number = ( dy - dx ) << 1; var x:Number = x1 + sx; var y:Number = y1; for(var i:Number = 1; i <= dx; i++) { if (d > 0) { d += d2; y += sy; } else d += d1; this.drawRect(movie, x, y, 1, 1, clr, alpha); x += sx; } } else { var d1:Number = dx << 1; var d:Number = d1 - dy; var d2:Number = (dx - dy) << 1; var x:Number = x1; var y:Number = y1 + sy; for (var i:Number = 1; i <= dy; i++) { if( d > 0) { d += d2; x += sx; } else d += d1; this.drawRect(movie, x, y, 1, 1, clr, alpha); y += sy; } }}_global.AquaLook.prototype.drawDrop = function(movie:MovieClip, x:Number, y:Number, w:Number, h:Number, col:Number, data:Object):Void{ movie.beginFill(0, 60); this.drawOvalRect(movie, x, y, w, h); movie.endFill(); var hsb:Object = this.rgb2hsb(col); var colors:Array = new Array( this.hsb2rgb({h:hsb.h, s:Math.max(0, hsb.s - 60), b:Math.min(100, hsb.b + 30)}), this.hsb2rgb({h:hsb.h, s:Math.max(0, hsb.s - 55), b:Math.min(100, hsb.b + 25)}), this.hsb2rgb({h:hsb.h, s:Math.max(0, hsb.s), b:Math.min(100, hsb.b - 12)}), this.hsb2rgb({h:hsb.h, s:Math.max(0, hsb.s), b:3})); //this.hsb2rgb({h:hsb.h, s:Math.max(0, hsb.s), b:Math.min(100, hsb.b - 65)}));//0xdffeab, 0xbfff55, 0x136806, 0); var alphas:Array = new Array(100, 100, 100, 100); var ratios:Array = new Array(0, 60, 140, 255); var w1:Number = w - 2; var h1:Number = h - 2; var matrix:Object = {a:w1 * 1.55, b:0, c:0, d:0, e:h1 * 1.55, f:0, g:x + 1 + w1 / 2, h:y + 1 + h1 * 0.85, i:1}; movie.beginGradientFill("radial", colors, alphas, ratios, matrix); this.drawOvalRect(movie, x + 1, y + 1, w1, h1); movie.endFill(); colors.splice(0); alphas.splice(0); ratios.splice(0); colors.push(0xffffff, 0xffffff); alphas.push(80, 10); ratios.push(65, 255); matrix = {a:w1 * 0.9, b:0, c:0, d:0, e:h1 * 0.5, f:0, g:x + w / 2, h:y + 1 + h1 * 0.1, i:1}; movie.beginGradientFill("radial", colors, alphas, ratios, matrix); this.drawOvalRect(movie, x + (w - w1 * 0.7) / 2, y + 1 + h1 * 0.02, w1 * 0.7, h1 * 0.35); movie.endFill(); delete colors; delete alphas; delete ratios; if(data.mode == "press") this.fillOvalRect(movie, x, y, w, h, 0, 20); else if(data.mode == "over") this.fillOvalRect(movie, x, y, w, h, 0xffffff, 20);}_global.AquaLook.prototype.drawRoundDrop = function(movie:MovieClip, x:Number, y:Number, w:Number, h:Number, col:Number, data:Object):Void{ var r:Number = Math.min(w, h) / 2; var w1:Number = w - 2; var h1:Number = h - 2; var r1:Number = Math.min(w1, h1) / 2; movie.beginFill(col, 100); this.drawRoundRect(movie, x + 1, y + 1, w - 1, h - 1, r - 1); movie.endFill(); if(w < h) { var colors:Array = new Array(0, 0); var alphas:Array = new Array(0, 50); var ratios:Array = new Array(160, 255); var matrix:Object = new Object({a:r1 * 3, b:0, c:0, d:0, e:r1 * 3, f:0, g:x + r, h:y + r * 1.4}); movie.beginGradientFill("radial", colors, alphas, ratios, matrix); this.drawOvalRect(movie, x + 1, y + 1, r1 * 2, r1 * 2); movie.endFill(); colors.splice(0); alphas.splice(0); ratios.splice(0); colors.push(0, 0); alphas.push(0, 50); ratios.push(160, 255); var matrix:Object = new Object({a:r1 * 3, b:0, c:0, d:0, e:r1 * 3, f:0, g:x + r, h:y + h - r * 1.4}); movie.beginGradientFill("radial", colors, alphas, ratios, matrix); this.drawOvalRect(movie, x + 1, y + h - r1 * 2 - 1, r1 * 2, r1 * 2); movie.endFill(); colors.splice(0); alphas.splice(0); ratios.splice(0); colors.push(0xffffff, 0xffffff, 0xffffff); alphas.push(65, 40, 35); ratios.push(10, 50, 100); var offX:Number = 1; var offY:Number = 1; matrix = {matrixType:"box", x:offX, y:offY, w:r1 * 2, h:h1, r:0}; movie.beginGradientFill("linear", colors, alphas, ratios, matrix); this.drawRoundRect(movie, x + 1, y + 1 + r1 / 4, r1 - 0.5, h - 1 - r1 / 4, r); movie.endFill(); colors.splice(0); alphas.splice(0); ratios.splice(0); colors.push(0xffffff, 0xffffff); alphas.push(0, 85); ratios.push(90, 235); var offX:Number = x + w - r1 * 2 - 1; var offY:Number = 1; matrix = {matrixType:"box", x:offX, y:offY, w:r1 * 2, h:h1, r:0}; movie.beginGradientFill("linear", colors, alphas, ratios, matrix); this.drawRoundRect(movie, x + w - r1 * 2 - 1, y + 1, x + w - 1, h - 1, r); movie.endFill(); } else { var colors:Array = new Array(0, 0); var alphas:Array = new Array(0, 50); var ratios:Array = new Array(160, 255); var matrix:Object = new Object({a:r1 * 3, b:0, c:0, d:0, e:r1 * 3, f:0, g:x + r * 1.4, h:y + r}); movie.beginGradientFill("radial", colors, alphas, ratios, matrix); this.drawOvalRect(movie, x + 1, y + 1, r1 * 2, r1 * 2); movie.endFill(); colors.splice(0); alphas.splice(0); ratios.splice(0); colors.push(0, 0); alphas.push(0, 50); ratios.push(160, 255); var matrix:Object = new Object({a:r1 * 3, b:0, c:0, d:0, e:r1 * 3, f:0, g:x + w - r * 1.4, h:y + r}); movie.beginGradientFill("radial", colors, alphas, ratios, matrix); this.drawOvalRect(movie, x + w - r1 * 2 - 1, y + 1, r1 * 2, r1 * 2);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -