Not sure if I named it properly, but this class allows you specify a linked bitmap from the library to act as a displacement filter for whatever movieclip you want. Pretty powerful stuff if you know how to do displacements in photoshop and can get the right grayscale. Anyway what do you all think?
Sorry about the bad link guys, it should be fixed now. Thanks for the comments and I’d love to see what you guys are using this for, I developed it myself to make stuff reflect off of shiny things. Displacement stuff rocks
serkios- I recommend adding methods for starting and stopping the onEnterFrame event. For example, rename the “onEnterFrame” in your class to “displace”, the add this:
public function startDisplacement():Void{
this.onEnterFrame = displace;
}
public function stopDisplacement():Void{
delete this.onEnterFrame;
}
The in your .fla you can add calls to startDisplacement and stopDisplacement in your onMouseUp and onMouseDown events:
text_mc.onMouseDown = function () {
text_mc.startDrag();
displacement.startDisplacement();
}
text_mc.onMouseUp = function () {
text_mc.stopDrag();
displacement.stopDisplacement();
}
This way the onEnterFrame isn’t running when it’s not needed.