Ghost in the flash interface
攻殻な機動隊っぽいインターフェイス
9時の方向にあるタブをクリックすると
それらしい何かが開きます
ドラッグできます
/**
* Copyright yukifuruyoru ( http://wonderfl.net/user/yukifuruyoru )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/w3so
*/
/*攻殻な機動隊っぽいインターフェイス*/
/*9時の方向にあるタブをクリックすると
それらしい何かが開きます*/
/*ドラッグできます*/
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main():void{
var w:GateG;
for(var i:uint=0;i<2;i++){
w=new GateG;
w.x=260-90*i;
w.y=200+80*i;
w.scaleX=0.6;
w.scaleY=0.6;
addChild(w);
}
}
}
}
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.geom.Matrix;
import flash.events.MouseEvent;
import net.kawa.tween.KTween;
import net.kawa.tween.KTJob;
import net.kawa.tween.easing.*;
import flash.filters.GlowFilter;
import flash.filters.DropShadowFilter;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.display.Shape;
class GateG extends Sprite {
private var rings:Sprite=new Sprite;
private var spikesa:Sprite=new Sprite;
private var spikesb:Sprite=new Sprite;
private var tabs:Sprite=new Sprite;
private var hole:Sprite=new Sprite;
private var dat:Sprite=new Sprite;
private var dat0:Sprite=new Sprite;
private var dat1:Sprite=new Sprite;
private var dat2:Sprite=new Sprite;
private var abanicos:Sprite=new Sprite;
public function GateG():void{
blendMode="layer";
initSpikesa();
initSpikesb();
initTabs();
initRings();
initAba();
initHole();
initFilters();
initDat();
tabs.addEventListener(MouseEvent.CLICK,initSpin);
addEventListener(MouseEvent.MOUSE_DOWN,function(...args):void{startDrag();});
addEventListener(MouseEvent.MOUSE_UP,function(...args):void{stopDrag();});
}
private function initFilters():void{
var f1: GlowFilter = new GlowFilter(0x8855ff);
f1.blurX=5;
f1.blurY=5;
f1.alpha=0.5;
var f2: DropShadowFilter = new DropShadowFilter();
filters=[f1,f2];
}
private function initAba():void{
var spr:Sprite=new Sprite;
for(var i:uint=0;i<6;i++){
spr.addChild(aba(190,172,5,188+i*7,0x55ffff));
}
for(i=0;i<6;i++){
spr.addChild(aba(190,172,5,278+i*7,0x55ffff));
}
abanicos.addChild(spr);
spr=new Sprite;
for(i=0;i<7;i++){
spr.addChild(aba(190,172,5,188+i*7,0xff5555));
}
for(i=0;i<7;i++){
spr.addChild(aba(190,172,5,278+i*7,0xff5555));
}
abanicos.addChild(spr);
addChild(abanicos);
}
private function initDat():void{
var spe:Shape=new Shape;
spe.graphics.beginFill(0xffffff);
spe.graphics.drawRect(32,0,64,6);
spe.graphics.drawRect(32,130,64,6);
spe.graphics.drawRect(0,10,128,118);
spe.graphics.beginFill(0xffff55);
spe.graphics.drawRect(0,12,16,116);
spe.graphics.drawRect(110,12,16,116);
spe.graphics.beginFill(0x333333);
spe.graphics.drawRect(18,12,90,116);
var bmp:BitmapData=new BitmapData(40,20,true);
bmp.noise(Math.random()*1000,0,255,7,true);
bmp.threshold(bmp,new Rectangle(0,0,40,20),new Point(0,0),"<",0xFF777777,0xFF000000);
bmp.threshold(bmp,new Rectangle(0,0,40,20),new Point(0,0),">=",0xFF777777,0xFFffffff);
spe.graphics.beginBitmapFill(bmp,new Matrix(2,0,0,4,23,38));
spe.graphics.drawRect(23,38,80,85);
spe.y=-(spe.height>>>1);
dat2.addChild(spe);
dat2.x=184;
dat2.x=122;
dat2.scaleY=0.2;
dat2.scaleX=0;
addChild(dat2);
spe=new Shape;
spe.graphics.beginFill(0xff0000);
spe.graphics.drawRect(0,0,212,350);
spe.x=-(spe.width>>>1);
spe.y=-56;
spe.blendMode="erase";
dat.addChild(spe);
spe=new Shape;
spe.graphics.beginFill(0xffffff);
spe.graphics.drawRect(0,0,200,340);
spe.graphics.drawRect(12,28,176,160);
spe.graphics.drawRect(100,200,86,120);
for(var i:uint=0;i<5;i++){
spe.graphics.drawRect(16,200+i*20,70,16);
}
spe.graphics.drawRect(62,300,24,20);
spe.graphics.endFill();
spe.graphics.lineStyle(3,0x555555);
spe.graphics.drawRect(5,5,190,330);
spe.graphics.lineStyle();
bmp=new BitmapData(43,31);
bmp.noise(Math.random()*1000,0,255,7,true);
bmp.threshold(bmp,new Rectangle(0,0,43,31),new Point(0,0),"<=",0xFF777777,0xFF000000);
bmp.threshold(bmp,new Rectangle(0,0,43,31),new Point(0,0),">",0xFF777777,0xFFffffff);
spe.graphics.beginBitmapFill(bmp,new Matrix(4,0,0,6,14,30));
spe.graphics.drawRect(14,30,172,156);
spe.graphics.endFill();
bmp=new BitmapData(120,1,true);
bmp.noise(Math.random()*1000,0,255,7,true);
spe.graphics.beginBitmapFill(bmp);
spe.graphics.drawRect(14,10,120,16);
bmp=new BitmapData(50,68,true);
bmp.noise(Math.random()*1000,0,255,7,true);
spe.graphics.beginBitmapFill(bmp,new Matrix(2,0,0,3,102,202));
bmp.threshold(bmp,new Rectangle(0,0,50,68),new Point(0,0),"<=",0xFF777777,0xFF000000);
bmp.threshold(bmp,new Rectangle(0,0,50,68),new Point(0,0),">",0xFF777777,0xFFffffff);
spe.graphics.drawRect(102,202,82,118);
spe.graphics.beginFill(0x333333);
spe.graphics.lineStyle(2,0xeecc00);
spe.x=-100;
spe.y=-52;
dat.addChild(spe);
for(i=0;i<5;i++){
spe.graphics.drawRect(18,202+i*20,65,11);
}
dat.scaleX=0;
dat.scaleY=0.2;
addChild(dat);
}
private function initSpin(...args):void{
KTween.to(spikesa,0.2,{rotation:30},Cubic.easeIn,a2);
KTween.to(tabs,0.2,{rotation:30},Cubic.easeIn);
function a2():void{
KTween.to(spikesa,0.2,{rotation:110},Cubic.easeIn,a3);
KTween.to(spikesb,0.2,{rotation:30},Cubic.easeIn,b2);
}
function a3():void{
KTween.to(spikesa,0.2,{rotation:120},Cubic.easeIn);
KTween.to(hole,0.5,{alpha:1});
KTween.to(dat2,0.2,{scaleX:1,x:182},c2);
KTween.to(dat,0.2,{scaleX:1});
if(abanicos.numChildren==2){abanicos.removeChildAt(1);}
}
function b2():void{
KTween.to(spikesb,0.2,{rotation:70},Cubic.easeIn);
KTween.to(tabs,0.2,{rotation:45},Cubic.easeIn);
}
function c2():void{
KTween.to(dat2,0.2,{scaleY:1});
KTween.to(dat,0.2,{scaleY:1});
}
}
private function initTabs():void{
tabs.addChild(choco(232,200,64,180));
tabs.addChild(choco(216,200,16,250));
addChild(tabs);
}
private function initSpikesa():void{
spikesa.addChild(choco(296,200,8,35));
spikesa.addChild(choco(232,200,4,135));
spikesa.addChild(choco(216,200,4,200));
spikesa.addChild(choco(232,200,4,310));
addChild(spikesa);
}
private function initSpikesb():void{
spikesb.addChild(choco(165,130,8,30));
spikesb.addChild(choco(165,130,8,110));
spikesb.addChild(choco(165,130,8,170));
spikesb.addChild(choco(165,130,4,215));
spikesb.addChild(choco(165,130,4,265));
spikesb.addChild(choco(165,130,16,290));
addChild(spikesb);
}
private function initRings():void{
rings.addChild(donut(200,164));
rings.addChild(donut(146,144));
rings.addChild(donut(136,0));
var deco:Sprite=new Sprite;
deco.graphics.beginFill(0x505050);
deco.graphics.drawRect(-192,-10,20,20);
deco.graphics.drawRect(-10,-192,20,20);
deco.graphics.drawRect(-50,-90,100,1);
var bmp:BitmapData=new BitmapData(180,1,true);
bmp.noise(Math.random()*1000,0,255,7,true);
deco.graphics.beginBitmapFill(bmp);
deco.graphics.drawRect(-90,-80,180,16);
var bmp2:BitmapData=new BitmapData(100,1,true);
bmp2.noise(Math.random()*1000,0,255,7,true);
deco.graphics.beginBitmapFill(bmp2);
deco.graphics.drawRect(-50,-105,100,12);
rings.addChild(deco);
addChild(rings);
}
private function initHole():void{
hole.graphics.beginFill(0xff0000);
hole.graphics.drawRect(-106,-58,212,116);
hole.graphics.drawRect(106,-50,12,100);
hole.graphics.drawRect(122,-8,6,16);
hole.graphics.drawRect(-120,-50,14,20);
hole.graphics.drawRect(-120,30,14,10);
hole.graphics.drawRect(-130,-10,16,32);
hole.graphics.endFill();
var tmas:Shape=new Shape;
tmas.graphics.beginFill(0x0000ff);
tmas.graphics.drawRect(-106,58,212,250);
tmas.graphics.endFill();
addChild(hole);
hole.blendMode="erase";
hole.alpha=0.01;
}
private function aba(a:uint,b:uint,c:uint,rot:int=0,color:uint=0xffffff):Sprite{
var spr:Sprite=donut(a,b,color);
var ma:Shape=new Shape;
ma.graphics.beginFill(0xff0000);
ma.graphics.lineTo(a,a*Math.tan(c*Math.PI/180));
ma.graphics.lineTo(a,0);
ma.graphics.lineTo(0,0);
spr.addChild(ma);
spr.mask=(spr.getChildAt(0));
spr.rotation=rot;
return spr
}
private function choco(a:uint,b:uint,c:uint,rot:int=0,color:uint=0xffffff):Sprite{
var spr:Sprite=donut(a,b,color);
var ma:Shape=new Shape;
ma.graphics.beginFill(0xff0000);
ma.graphics.drawRect(0,-(c>>1),a,c);
spr.addChild(ma);
spr.mask=(spr.getChildAt(0));
spr.rotation=rot;
return spr;
}
private function donut(a:uint,b:uint,color:uint=0xffffff):Sprite{
var spr:Sprite=new Sprite;
spr.graphics.beginFill(color);
spr.graphics.drawCircle(0,0,a);
spr.graphics.drawCircle(0,0,b);
spr.graphics.endFill();
return spr;
}
}