Heart
/**
* Copyright wwbeyondww1 ( http://wonderfl.net/user/wwbeyondww1 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/Aw7G
*/
package {
import flash.display.Shape;
import flash.display.Sprite;
import flash.filters.GlowFilter;
import flash.filters.DropShadowFilter;
import flash.events.Event;
[SWF(backgourndColor=0x0)]
public class FlashTest extends Sprite {
private var _x:int=200;
private var _y:int=200;
private var glowFilter1:GlowFilter=new GlowFilter(0xFFFFFF,1,16,8,3,3,true,false);
private var glowFilter2:GlowFilter=new GlowFilter(0xFF0000,1,8,8,3,3,false,false);
private var dropShadowFilter:DropShadowFilter=new DropShadowFilter(0,90,0xCCFFFF,1,64,64,5,3);
private var canvas:Shape=new Shape();
private var i:int=0;
public function FlashTest() {
// write as3 code here..
init();
addEventListener(Event.ENTER_FRAME,onEnterFrame);
}
private function init():void
{
addChild(canvas);
canvas.filters=[glowFilter1, glowFilter2,dropShadowFilter];
canvas.graphics.lineStyle(1,0xCC00CC,1);
canvas.graphics.beginFill(0xff0000);
canvas.graphics.moveTo(_x,_y)
}
private function onEnterFrame(e:Event):void
{
if(i<=720)
{
var t:Number=Math.PI*i/180;
var x:Number=_x+5*16*Math.pow(Math.sin(t),3);
var y:Number=_y-5*(13*Math.cos(t)-5*Math.cos(2*t)-2*Math.cos(3*t)-Math.cos(4*t));
canvas.graphics.lineTo(x,y);
i++;
}
}
}
}