Author Archives: Zevan

Circle Mouse Toy

CLICK HERE TO COPY
Actionscript:

var circles:Array = [];

for (var i:int = 0; i<30; i++){

    var c:Sprite = makeCircle();

    c.x = stage.stageWidth / 2;

    c.y = stage.stageHeight / 2;

    c.scaleX = 1 + i/2;

    c.scaleY = 0.5 + i/4;

    addChild(c);

    circles.push(c);

}

addEventListener(Event.ENTER_FRAME, onLoop);

function onLoop(evt:Event):void {

    circles[0].y += (mouseY - circles[0].y) [...]

Posted in Graphics, misc, motion | Tagged , , | 5 Comments

TextLineMetrics

CLICK HERE TO COPY
Actionscript:

var word:String = "TextLineMetrics are useful";

var letters:Array = word.split("");

 

var pre:TextField;

for (var i:int = 0; i<letters.length; i++){

    var t:TextField = new TextField();

    t.defaultTextFormat = new TextFormat("Arial", 40);

    t.autoSize = TextFieldAutoSize.LEFT;

    t.textColor = int(Math.random() * 0xFFFFFF);

    t.text = letters[i];

    if (pre){

        var metrics:TextLineMetrics = pre.getLineMetrics(0);

  [...]

Posted in string manipulation, strings | Tagged , , | 6 Comments

QuickBox2D Editor

When I first created QuickBox2D I simultaneously developed a simple editor to aid in the creation of complex simulations. The result is very alpha and should be used cautiously. There is no UI, it is entirely key controlled. It generates actionscript files that can be copy and pasted into working simulations. It also has a [...]

Posted in QuickBox2D | Tagged , , , , | 19 Comments

Gesture Capture Performance

I'll be doing a drawing performance using something I created called Gesture Capture tomorrow April 9th in Brooklyn at the former Engine Co. 212 firehouse. The performance will happen at random intervals between 6pm and 10pm. There will be two other performances going on by Julie Fotheringham, Vera Angelica and Zahava Rozman. Here is some [...]

Posted in Announcements | Tagged , , | 2 Comments

Relaxing with Sine and Cosine

Last night I wanted to play with sine and cosine waves so I created this snippet:
CLICK HERE TO COPY
Actionscript:

var wave:Number = 0;

addEventListener(Event.ENTER_FRAME, onLoop);

function onLoop(evt:Event):void {

       graphics.clear()

       graphics.lineStyle(0,0);

       var time:Number = (stage.stageWidth/2 - mouseX)/10

       for (var j:int = 0; j<100; j++){

               var [...]

Posted in Uncategorized | 4 Comments

Recursion Form

CLICK HERE TO COPY
Actionscript:

x = y = 10

graphics.lineStyle(1,0);

drawBox(6);

 

function drawBox(iter:Number=10, count:Number=1, y:Number=0, w:Number=500):void{

       if (count <iter){

               var width:Number = w / count

               for (var i:int = 0; i<count; i++){

                   graphics.drawRect(i * width, width * [...]

Posted in Graphics, functions | Tagged , , | 6 Comments

QuickBox2D Editor 2B Released

I'll be releasing the QuickBox2D on googlecode in the near future based on the response to yesterdays post.

Posted in QuickBox2D | Tagged , , , , | 12 Comments

To release or not to release…

So I have a QuickBox2D editor that I've had since the earliest version of QuickBox2D. It is really pretty buggy and imperfect. I'm wondering if I should release it even though it's really buggy... my main issue is I won't be able to guarantee that it is a safe editor to use for real projects. [...]

Posted in QuickBox2D | Tagged , | 13 Comments

AS Quiz #18

Today's quiz is about BitmapData and the Graphics class...
Number of Questions : 5
Difficulty : Medium
Topic : BitmapData, Graphics

Posted in Quiz | Tagged , , , | 8 Comments

Logistic Map Play

CLICK HERE TO COPY
Actionscript:

var offX:Number = 100;

var offY:Number = 300;

var scalarX:Number = 6;

var scalarY:Number = 200;

addEventListener(Event.ENTER_FRAME, onLoop);

function onLoop(evt:Event):void{

    var r:Number = mouseY / 100;

    var xn:Number = (mouseX - 100) / 650;

    var xn1:Number = 0;

    graphics.clear();

    graphics.lineStyle(0,0);

    for (var i:int = 0; i<100; i++){

      xn1 = [...]

Posted in Graphics, Math, misc | Tagged , , | 2 Comments