As we know, AS2.0 has no bulit-in function to make the image reflection effect that users cannot make it from external loaded image dynamically. Therefore, I recently created a class to make it for ease.Here is the client code used to make the shadow:
import flash.display.BitmapData;
// create the image
var bmd:BitmapData = BitmapData.loadBitmap("Cat");
var mc:MovieClip = this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
mc.attachBitmap(bmd, 0, "auto", true);
mc._x = (Stage.width - mc._width) / 2;
mc._y = 0;
// create the image reflection
var ir:MovieClip = attachMovie(ImageReflection.idName, "ir_mc", this.getNextHighestDepth());
ir.setBitmapData(bmd);
ir.place(mc, true);
Simple? The class wraps everything about the reflection effect. Here, the image reflection is also itself a movieclip so it can easily be altered its movieclip attritues.
The following attributes of the reflection can be changed:
- _yscale (default -100)
- _y (2px from the original image)
- _alpha (default 50)
- filters (default using the blur filter)

(80 alpha with no Blur effect)
No comments:
Post a Comment