PDA

View Full Version : trippy box spining thingy



ajcates
August 7th, 2006, 10:38 PM
import flash.geom.ColorTransform;
import flash.geom.Transform;
var colorTrans:ColorTransform = new ColorTransform();
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random()*(max-min+1))+min;
return randomNum;
}
function box(width:Number, height:Number, color:Number, y, x, rotate, lineSize,alpha, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("box"+depth+"box_mc", depth);
mc.beginFill(color,alpha);
mc.lineStyle(lineSize);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
mc._x = x;
mc._y = y;
mc.onEnterFrame = function() {
mc._rotation += rotate;
};
return mc;
}
for (var i:Number = 0; i<100; i++) {
var rect = box(randRange(60, 120), randRange(60, 120), 0xffffff, randRange(-80, Stage.height), randRange(-80, Stage.width), randRange(-16, 16), randRange(2, 10),randRange(0,100));
var trans = new Transform(rect);
trans.colorTransform = colorTrans;
colorTrans.greenOffset = randRange(-255, 255);
colorTrans.blueOffset = randRange(-255, 255);
colorTrans.redOffset = randRange(-255, 255);
}


//what you think of it??

codemonkeypete
August 8th, 2006, 12:57 AM
trippy!!!:krazy: great use of variables. well done man. wondering how this would look with flash8's blur filter applied? (randomed of course...)

phorte
August 8th, 2006, 01:56 AM
Any chance of a swf? for us lazy ppl.

pixi
August 8th, 2006, 04:47 AM
http://img212.imageshack.us/my.php?image=testgeomzb2.swf

spud99
August 8th, 2006, 11:02 AM
lol mad me feel sick after a while, very nice and colourful :)

Ohls
August 8th, 2006, 04:31 PM
well its trippy for sure =P. Good for making random things I guess =)

TNTWolverine
August 10th, 2006, 06:38 PM
i really like it, i get that weird feeling too...however, this kinda thing always upsets me(not ur fault) because flash is always eating my cpu

codemonkeypete
August 10th, 2006, 08:19 PM
really tnt?... i tested it on a 486 and it worked fine :evil:
..seriously though, ran smooth on a pentium4 -2.8ghz, 1gb ram.

TNTWolverine
August 11th, 2006, 11:36 AM
well now its better on my comp but i have a nice dell laptop and it was at about 75% which was still smooth, just i hate that flash is like that