Monday, July 6, 2009

Interactive Color Coded Grids

What I want to do is make visualizations of grids (for churn, etc) that are interactive. This was a nice start tonight but flash development still goes so slow for me...





public function Blueray()
{
for(var i:int = 0; i < 5; i++){
for(var j:int = 0; j < 5; j++){
var a:Sprite = new Sprite(); a.graphics.beginFill(0xFF0000);
a.graphics.drawRect(50*i, 50*j, 50, 50);
this.addChild(a);
a.transform.colorTransform =new ColorTransform(1, 1, 1, 1, -50*i, 0, 50*j, 0);
a.addEventListener(MouseEvent.MOUSE_DOWN, drag);
a.addEventListener(MouseEvent.MOUSE_UP, stopdrag);
}
}
}
private function drag(event:MouseEvent):void {
event.target.startDrag();
}
private function stopdrag(event:MouseEvent):void {
event.target.stopDrag();
}

0 comments: