flash on 2015-5-9
/**
* Copyright Tadao.Watanabe ( http://wonderfl.net/user/Tadao.Watanabe )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/gn0o
*/
package
{
import adobe.utils.CustomActions;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
[SWF(backgroundColor="0x000000")]
public class Main extends Sprite
{
public function Main():void
{
var l:int = Math.random() * 5;
var r:int = Math.random() * 5;
var con0:Sprite = new Sprite();
con0.x = 80.3;
var con1:Sprite = new Sprite();
con1.x = 52;
var con2:Sprite = new Sprite();
con2.x = stage.stageWidth / 2;
con2.y = stage.stageHeight / 2;
con1.addChild (con0);
con2.addChild (con1);
addChild (con2);
var quellPunkt:Point = new Point(0,0);
var stagePoint:Point;
stagePoint = con0.localToGlobal(quellPunkt);
var myMovieClip:MovieClip= new MovieClip();
this.addChild (myMovieClip);
myMovieClip.graphics.lineStyle (1, Math.random()*0xffffff, 1);
myMovieClip.graphics.moveTo (stagePoint.x,stagePoint.y);
var loop:Function;
var text:TextField = new TextField;
text.defaultTextFormat = new TextFormat("default", 100, 0xffffff );
text.x = 30;
text.y = 250;
text.alpha = 0;
text.width = stage.stageWidth - 20;
text.height = stage.stageHeight - 20;
text.text = "DJ AKIRA SADA";
stage.addChild(text);
loop = Turn_FadeIn;
stage.addEventListener(Event.ENTER_FRAME, OnEnterFrame);
function Turn_FadeIn():void
{
if ( text.alpha < 1 )
{
text.alpha += 0.01;
}
else
{
loop = Turn_FadeOut;
}
}
function Turn_FadeOut():void
{
if ( text.alpha > 0 )
{
text.alpha -= 0.01;
}
else
{
loop = Turn_FadeIn;
}
}
function OnEnterFrame(e:Event):void
{
loop();
}
this.addEventListener (Event.ENTER_FRAME, onEnterFrameEvent);
var i:uint=0;
function onEnterFrameEvent (evt:Event):void
{
con1.rotation += 5+l;
con2.rotation -= 2+r;
stagePoint = con0.localToGlobal(quellPunkt);
myMovieClip.graphics.lineTo (stagePoint.x,stagePoint.y);
i++;
if(i>500)
{
myMovieClip.graphics.clear();
this.addEventListener(Event.ENTER_FRAME, myMovieClip);
}
}
}// main func
}// extends Sprite
}//package