By Zevan | April 24, 2010
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) [...]
By Zevan | April 23, 2010
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);
[...]
By Zevan | April 16, 2010
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 [...]
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 [...]
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 [...]
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 * [...]
I'll be releasing the QuickBox2D on googlecode in the near future based on the response to yesterdays post.
By Zevan | March 31, 2010
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. [...]
By Zevan | March 30, 2010
Today's quiz is about BitmapData and the Graphics class...
Number of Questions : 5
Difficulty : Medium
Topic : BitmapData, Graphics
Posted in Quiz | Tagged actionscript, as3, flash, Quiz |
By Zevan | March 27, 2010
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 = [...]