Author Archives: Zevan

Four by Four

Two years ago I had an idea for a programming experiment. After writing a proof of concept in Processing, I never did anything else with it. A few weeks back I decided to revisit the project and I created a finalized version. Have a look at it here (the instructions are important so be sure [...]

Posted in Uncategorized | Tagged , , , | 4 Comments

Graphics Class and Twitter

CLICK HERE TO COPY
Actionscript:

[SWF(width = 700, height=700, frameRate=12)]

var cmds:Array = [];

 

var loader:URLLoader = new URLLoader();

var req:URLRequest = new URLRequest("http://search.twitter.com/search.atom");

var vars:URLVariables = new URLVariables();

vars.q = "#asgraph";

// results per page

vars.rpp = "100";

vars.page = 1;

 

req.data = vars;

req.method = URLRequestMethod.GET;

 

loader.addEventListener(Event.COMPLETE, onLoaded);

loader.load(req);

 

var txt:TextField = TextField(addChild(new TextField()));

txt.defaultTextFormat = new TextFormat("_sans", 12);

with (txt){ x=10, y=10, autoSize="left"; }

txt.htmlText = "loading...";

 

function onLoaded(evt:Event):void{

      [...]

Posted in Graphics, external data | Tagged , , | 3 Comments

Paste an Arbitrary Piece of Code

CLICK HERE TO COPY
Actionscript:

...

// loop through until we find the root note

    // grab the third and the fifth and exit the loop

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

        if (cMajor[i] == note){

            third = cMajor[(i + 2) % leng];

          [...]

Posted in misc | Tagged , , | 15 Comments

QuickBox2D Mini-Poly Editor

CLICK HERE TO COPY
Actionscript:

[SWF(width = 800, height = 600, frameRate = 60)]

import com.actionsnippet.qbox.*;

stage.frameRate = 60;

 

var sim:QuickBox2D = new QuickBox2D(this);

 

sim.createStageWalls();

 

sim.start();

 

var output:TextField = new TextField();

output.text = "Click anywhere to add points to a polygon. Hit any key to test.\n\n";

output.x = output.y = 50;

with(output) width = 300, height = 400, border = true, selectable = true, wordWrap = [...]

Posted in Box2D, QuickBox2D | Tagged , , , , | 26 Comments