Author Archives: Zevan

New Site zReference

Actionsnippet has been pretty inactive for the last few months. I took a short break from blogging, but I’m starting up again on a new site… go check it out: zReference

Posted in misc | Tagged | 3 Comments

Quick IE Test

Found this today, not related to actionscript but rather nice. It allows you to take a screen shot of your website in IE… if your on a mac without windows this is a quick way to test in a pinch:
http://ipinfo.info/netrenderer/index.php

Posted in Uncategorized | 6 Comments

Circle Fitting

CLICK HERE TO COPY
Actionscript:

var circs:Array = []

var circNum:int = 600;

addEventListener(Event.ENTER_FRAME, onAdd);

function onAdd(evt:Event):void {

    if (circs.length <circNum){

        makeGrowable();

    }

}

 

function makeGrowable(){

   

    var s:MovieClip = MovieClip(addChild(new MovieClip()));

    s.x = Math.random() * stage.stageWidth;

    s.y = Math.random() * stage.stageHeight;

    with(s.graphics){

        lineStyle(0,0);

        drawCircle(0,0,10);

    [...]

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

Fill in the Blank

CLICK HERE TO COPY
Actionscript:

var story:String = "Fill in the _____.";

 

 

var txt:TextField = new TextField();

txt.defaultTextFormat = new TextFormat("Georgia", 20);

txt.width = stage.stageWidth;

txt.multiline = true;

txt.wordWrap = true;

txt.text = story;

addChild(txt);

 

var alph:Array = "abcdefghijklmnopqrstuvwxyz".split("");

var keys:Object = {};

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

    keys[65 + i] = alph[i];

}

stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);

function onKeyPressed(evt:KeyboardEvent):void{

     

    if (evt.keyCode == Keyboard.ENTER){

      [...]

Posted in TextField, UI | Tagged , , | 3 Comments