forked from: flash on 2009-2-15
// forked from muller's flash on 2009-2-15
package {
import flash.display.Sprite;
import flash.display.Shape;
import flash.events.MouseEvent;
import flash.filters.DropShadowFilter;
import caurina.transitions.Tweener;
import caurina.transitions.properties.ColorShortcuts;
public class FlashTest extends Sprite {
public function FlashTest() {
// write as3 code here..
ColorShortcuts.init();
initObjects();
}
private function initObjects():void{
var container:Sprite = new Sprite();
container.x = 120;
container.y = 20;
addChild(container);
for(var i:int=0; i<10; i++){
var randomW:int = Math.random()*50;
var rect:Sprite = new Sprite();
rect.graphics.beginFill(0x1F1F1F);
rect.graphics.drawRect(-100,i*43,150+randomW,40);
rect.graphics.endFill();
container.addChild(rect);
rect.buttonMode = true;
rect.addEventListener(MouseEvent.ROLL_OVER,overFunc);
rect.addEventListener(MouseEvent.ROLL_OUT,outFunc);
var shadow:DropShadowFilter = new DropShadowFilter(2, 90, 0x000000, 0.7);
rect.filters = [shadow];
}
}
private function overFunc(event:MouseEvent):void{
Tweener.addTween(event.target,{scaleX:1.1,_color:0x31B8Da,time:1.0});
}
private function outFunc(event:MouseEvent):void{
Tweener.addTween(event.target,{scaleX:1.0,_color:0x1F1F1F,time:1.0});
}
}
}