package {
import com.flashdev.bitmap.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.filters.*;
public class ReflectionTest extends Sprite {
public function ReflectionTest() {
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
var loadImg:Loader = new Loader();
loadImg.contentLoaderInfo.addEventListener(Event.COMPLETE, onImgLoaded);
loadImg.load(new URLRequest("image.jpg"));
}
private function onImgLoaded(event:Event):void {
var sprImg:Sprite = new Sprite();
var disImg:DisplayObject = event.target.content;
var filGlow:GlowFilter = new GlowFilter(0x000000, .3, 8, 8, 1, 3, false, false);
disImg.filters = [filGlow];
sprImg.addChild(disImg);
var sprReflect:Reflection = new Reflection(disImg, .4, .2, 0, 0, 1);
sprImg.addChild(sprReflect);
sprImg.x = (this.stage.stageWidth - sprImg.width) / 2;
sprImg.y = (this.stage.stageHeight - sprImg.height) / 2;
this.addChild(sprImg);
}
}
}