# Question about Liquify animation

**URL:** <https://forum.kirupa.com/t/question-about-liquify-animation/178740>\
**Category:** flash\
**Created:** [February 13, 2006, 9:57pm UTC](https://forum.kirupa.com/t/question-about-liquify-animation/178740 "2006-02-13T21:57:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![structured](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@structured](https://forum.kirupa.com/u/structured)\
**Post date:** [February 13, 2006, 9:57pm UTC](https://forum.kirupa.com/t/question-about-liquify-animation/178740/1 "2006-02-13T21:57:43Z")

</div>

I have downloaded this fla:  
[http://www.kirupa.com/developer/mx2004/liquify.htm](http://www.kirupa.com/developer/mx2004/liquify.htm)

I’d like to use this liquify effect, but I’d like it to run automatically on an enterFrame function, either to set path or random, not on on the onRollOver.

I see the places that call for the x and y position of the mouse, but how would I go about modifing that code to make it run on it’s own?

thanks, Structured.  
//Liquefy an image ////////////  
//by michael at in2mind  
/////////////////////////////  
//make an empty movie clip  
var theRubberizer:MovieClip = this.createEmptyMovieClip(“theScene”, this.getNextHighestDepth());

//set up the max num of copies to make (20 is comfy)  
var maxImages:Number = 20;

///give me an object that has an array of duped images and an array of duped masks  
dupeAndPlace = function (image:MovieClip):Object {

```
var arrHolder:Object = new Object();
arrHolder.pics_arr = new Array(0);
arrHolder.masks_arr = new Array(0);

for (var i = 1; i&lt;maxImages; i++) {
	var dnm = "image" + i;
	var mnm = "mask" + i;
	
	// initObj's for the duplicates
	var imgObj = {_x:image._x, _y:image._y, _xscale:100+(i*1.7), _yscale:100+(i*1.7)};
	var maskObj = {_xscale:Math.floor(100/i+3), _yscale:Math.floor(100/i+3), _x:this._xmouse, _y:this._ymouse};
	
	var theDupedImage = image.duplicateMovieClip(dnm, theScene.getDepth()+ i, imgObj);
	var theDupedMask = mask_mc.duplicateMovieClip(mnm, theScene.getDepth()+(i*50), maskObj);
		
	theDupedImage.setMask(theDupedMask);
	
	arrHolder.pics_arr.push(theDupedImage);
	arrHolder.masks_arr.push(theDupedMask);
	
}

//make these invisible ot there'll be a non-moving 'dimple' of a mask left over
mask_mc._visible = false;
mask1._visible=false;
image1._visible=false;

//return the object
return arrHolder;

```

};

//this is called from down below. it takes an array as its arg (the masks array we pushed earlier)  
//loop through all of them and they follow the mouse at speeds dependent on their  
//index in the array  
makeWaves = function (masks\_arr:Array) {  
for (var i = masks\_arr.length; i\>0; i–) {  
masks\_arr\*.\_x += (this.\_xmouse-masks\_arr\*.\_x)/maxImages_i;  
masks\_arr_.\_y += (this.\_ymouse-masks\_arr\*.\_y)/maxImages\*i;  
}  
};  
///the func to call /////////  
this.liquefyImage = function(theImage:MovieClip){  
var arrHolder:Object = dupeAndPlace(theImage);

```
theRubberizer.onEnterFrame = function(){
	makeWaves(arrHolder.masks_arr);
}

```

}  
////when you rollOver pic\_mc, it’ll become liquid  
pic\_mc.onRollOver = function(){  
liquefyImage(pic\_mc);  
}  
////////////////////////////have a nice day!🙂 //  
//
