Instance of Symbol 12 MovieClip [RainDropEffect] in Frame 1
//component parameters
onClipEvent (construct) {
_targetInstanceName = "img_mc";
_dropInterval = 0;
_mouseSensetive = true;
_waveHeight = 2.1;
}
Symbol 12 MovieClip [RainDropEffect] Frame 1
#initclip 4
Object.registerClass("RainDropEffect", net.flashfilter.effects.E01_raindrop);
#endinitclip
Symbol 4 MovieClip [__Packages.net.flashfilter.effects.SuperEffect] Frame 0
class net.flashfilter.effects.SuperEffect extends MovieClip
{
var _source_mc, _source2_mc, _parent, _boundX, _boundY, _x, _y, _sourceBitmapData, _targetMovieClip, createEmptyMovieClip, getNextHighestDepth, _w, _h, _sourceBitmapData2, _logo_mc, dispatchEvent;
function SuperEffect () {
super();
}
function init(source_mc, source2_mc) {
mx.events.EventDispatcher.initialize(this);
if (source_mc == undefined) {
trace("ERROR - No target movieclip undefined!");
return(undefined);
}
_source_mc = source_mc;
_source2_mc = source2_mc;
_source_mc._x = Math.round(_source_mc._x);
_source_mc._y = Math.round(_source_mc._y);
var _local2 = _source_mc.getBounds(_parent);
_boundX = _local2.xMin;
_boundY = _local2.yMin;
_x = _boundX;
_y = _boundY;
_sourceBitmapData = getSourceBitmapData(_source_mc);
_targetMovieClip = createEmptyMovieClip("target_mc", getNextHighestDepth());
_w = _sourceBitmapData.width;
_h = _sourceBitmapData.height;
if (_source2_mc != undefined) {
_sourceBitmapData2 = getSourceBitmapData(_source2_mc);
} else {
_sourceBitmapData2 = getSourceBitmapData(_source_mc);
}
_source_mc._visible = false;
_source2_mc._visible = false;
_logo_mc._visible = false;
}
function getSourceBitmapData(mc) {
var _local4 = new flash.display.BitmapData(mc._width, mc._height, true, 0);
var _local3 = mc.getRect(mc);
var _local2 = new flash.geom.Matrix();
_local2.translate(_local3.xMin * -1, _local3.yMin * -1);
_local4.draw(mc, _local2);
return(_local4);
}
function onAnimationFinished() {
dispatchEvent({type:"onComplete", target:this});
}
function kill() {
_source_mc._visible = true;
_source2_mc._visible = true;
}
}
Symbol 5 MovieClip [__Packages.net.flashfilter.effects.E01_raindrop] Frame 0
class net.flashfilter.effects.E01_raindrop extends net.flashfilter.effects.SuperEffect
{
var _targetInstanceName, _parent, _waveHeight, _dropInterval, _mouseSensetive, damper, _w, _h, result, result2, source, buffer, output, surface, _sourceBitmapData, bounds, origin, matrix, matrix2, drop, wave, damp, water, _targetMovieClip, onEnterFrame, _rainingInterval, onMouseMove, getSourceBitmapData, _source_mc;
function E01_raindrop () {
super();
mx.events.EventDispatcher.initialize(this);
if (_parent[_targetInstanceName] != undefined) {
init(_parent[_targetInstanceName], _waveHeight, _dropInterval, _mouseSensetive);
}
}
function init(source_mc, waveHeight, dropInterval, mouseSensetive) {
super.init(source_mc);
if (waveHeight == undefined) {
trace("ERROR - Wave Height is not defined properlly!");
return(undefined);
}
_waveHeight = waveHeight;
if (dropInterval == undefined) {
trace("ERROR - Drop Interval is not defined properlly!");
return(undefined);
}
_dropInterval = dropInterval;
if (mouseSensetive == undefined) {
trace("ERROR - Mouse Move is not defined properlly!");
return(undefined);
}
_mouseSensetive = mouseSensetive;
damper = new flash.display.BitmapData(_w / 2, _h / 2, false, 128);
result = new flash.display.BitmapData(_w / 2, _h / 2, false, 128);
result2 = new flash.display.BitmapData(_w, _h, false, 128);
source = new flash.display.BitmapData(_w / 2, _h / 2, false, 128);
buffer = new flash.display.BitmapData(_w / 2, _h / 2, false, 128);
output = new flash.display.BitmapData(_w, _h, true, 0);
surface = _sourceBitmapData;
bounds = new flash.geom.Rectangle(0, 0, _w / 2, _h / 2);
origin = new flash.geom.Point();
matrix = new flash.geom.Matrix();
matrix2 = new flash.geom.Matrix();
matrix2.a = (matrix2.d = 2);
drop = new flash.geom.Rectangle(0, 0, 6, 6);
wave = new flash.filters.ConvolutionFilter(3, 3, [1, 1, 1, 1, 1, 1, 1, 1, 1], 9, 0, true, true, 128);
damp = new flash.geom.ColorTransform(0, 0, 0.99609374, 1, 0, 0, 2, 0);
water = new flash.filters.DisplacementMapFilter(result2, origin, 4, 4, _waveHeight * 10, _waveHeight * 10, "ignore");
_targetMovieClip.attachBitmap(output, 1);
onEnterFrame = render;
if (_dropInterval != 0) {
_rainingInterval = setInterval(this, "rain", _dropInterval * 1000);
rain();
}
}
function render() {
if (_mouseSensetive) {
onMouseMove = function () {
this.createDrop(this._xmouse, this._ymouse);
};
}
if (!isStop) {
surface = getSourceBitmapData(_source_mc);
result.applyFilter(source, bounds, origin, wave);
result.draw(result, matrix, null, "add");
result.draw(buffer, matrix, null, "difference");
result.draw(result, matrix, damp);
result2.draw(result, matrix2, null, null, null, true);
output.applyFilter(surface, new flash.geom.Rectangle(0, 0, _w, _h), origin, water);
buffer = source;
source = result.clone();
}
}
function createDrop(x, y) {
if (!isStop) {
drop.x = x / 2;
drop.y = y / 2;
source.fillRect(drop, 4278190335);
}
}
function rain() {
createDrop(random(_w), random(_h));
}
function onAnimationFinished() {
}
function stop() {
isStop = true;
}
function replay() {
isStop = false;
}
function kill() {
clearInterval(_rainingInterval);
onEnterFrame = null;
super.kill();
}
static var symbolName = "E01_raindrop";
static var symbolOwner = net.flashfilter.effects.E01_raindrop;
var className = "E01_raindrop";
var isStop = false;
}
Symbol 13 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}