A few years ago I needed something similar. Fortunately, Grant Skinner has already developed camgoo .
I still have my quick and dirty port. Note. You will need a MovieClip in the library with the image you want to convert, linked as Img and a MovieClip brush linked as Brush. The easiest way to get started is to grab the characters from the source source as2 on the Grant Skinner website, put them in an as3 document, and if it is in the Morph class, just try something like addChild (new Morph ());
The code is not optimized at all; it is a fairly fast and literal port. The actionscript-3 functions are not used at best:
package { import flash.display.*; import flash.events.*; import flash.geom.*; import flash.filters.*; public class Morph extends Sprite { private var rect:Rectangle; private var mapBmp:BitmapData; private var blurredMapBmp:BitmapData; private var blurF:BlurFilter; private var pt:Point; private var dispMapF:DisplacementMapFilter;
George Profenza
source share