By Zevan | March 29, 2009
CLICK HERE TO COPY
Actionscript:
x = stage.stageWidth / 2;
y = stage.stageHeight / 2;
var xp:Number = 0, yp:Number = 0;
var r:Number = 0, t:Number = 0;
var speed:Number = .07;
var scale:Number = 20;
var plot0:Shape = Shape(addChild(new Shape()));
var plot1:Shape = Shape(addChild(new Shape()));
plot0.graphics.lineStyle(0,0x000000);
plot1.graphics.lineStyle(0,0x000000);
addEventListener(Event.ENTER_FRAME, onLoop);
function onLoop(evt:Event):void {
r = scale * Math.sqrt(t);
xp = r * Math.cos(t);
yp [...]
By Zevan | March 28, 2009
CLICK HERE TO COPY
Actionscript:
var Pnt:Function = function(xp:Number, yp:Number){
var x:Number = xp;
var y:Number = yp
this.setX = function(v:int):void{
x = v;
}
this.setY = function(v:int):void{
y = v;
}
this.getX = function():int {
return [...]
By Zevan | March 27, 2009
CLICK HERE TO COPY
Actionscript:
var multBy2Add3:Function = add(3, mult(2));
trace(multBy2Add3(10));
// 10 * 2 = 20
// 20 + 3 = 23
var add2AndSquare = sq(add(2));
trace(add2AndSquare(8));
// 8 + 2 = 10
// 10 * 10 = 100
var multBy2_3times:Function = repeat(3,mult(2));
trace(multBy2_3times(3));
// 3 * 2 = 6;
// 6 * 2 = 12;
// 12 * 2 = 24
// you can also chain for even [...]
By Zevan | March 26, 2009
Just wanted to post a link to Joa Ebert's ActionScript Wiki. Looks like there's some great stuff there...
Posted in misc | Tagged actionscript, flash |