flash on 2013-6-10
/**
* Copyright mutantleg ( http://wonderfl.net/user/mutantleg )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/8uQX
*/
package {
import flash.events.Event;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
// write as3 code here..
stage.addEventListener(Event.ENTER_FRAME, onEnter);
}//ctor
public var ang:Number = 0;
public var bang:Number = 0;
public function onEnter(e:Event):void
{
var rx:Number;
var ry:Number;
var rz:Number;
var sx:Number;
var sy:Number;
var va:Number;
var i:int;
var num:int;
graphics.clear();
graphics.lineStyle(2,0);
ang += 0.02;
bang += 0.03;
va = ang;
num = 16;
for (i = 0; i < num; i++)
{
rx = Math.sin(va) * 64;
ry = (Math.sin(bang)*Math.cos(bang))*64;
rz = Math.cos(va) * 64 + 128;
va += 6.28/num;
if (rz == 0) { rz =0.000001;}
if (rz < 0) { continue;}
sx = (rx*256) / rz + 200;
sy = (ry*256) / rz + 200;
graphics.beginFill(0,1);
graphics.drawCircle(sx, sy, 8);
graphics.endFill();
ry = 60;
if (rz == 0) { rz =0.000001;}
if (rz < 0) { continue;}
sx = (rx*256) / rz + 200;
sy = (ry*256) / rz + 200;
graphics.moveTo(sx-4,sy);
graphics.lineTo(sx+4,sy);
}//onenter
}//onenter
}//classend
}