« Powerpoint to Flash | Main | removeMovieClip and onUnload conflict »

December 22, 2004

Polaroid image processing with Flash

Ok so someone blogged "Polaroid image processing with GDI+ in ASP.NET" on fullasagoog so for a bit of a laugh I had to do it in Flash.
Just type or copy the URL of an image into the first field, any text into the second field and press the Polaroid! button.



URL
Text 




I know it wasn't really the point but instead of "Skills Required: C#, ASP.NET, GDI+." you now have "Skills Required: Flash (basic)"

It is took about 20 lines of very basic code, of course you could do the same thing with our XPComponents in two lines of code for example:
imgbox.source=myPicURL?myPicURL:"sample.jpg";
lbl.text=myPicText?myPicText:"Another Flash moment";


URL
Text 

Anway here's the code for the basic flash version
var picURL = myPicURL?myPicURL:"sample.jpg";
var picText = myPicText?myPicText:"Another Flash moment";
this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.parent=this;
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc._x=47;
target_mc._y=95;
target_mc._width=217;
target_mc._height=205;
target_mc._rotation=-15;
this.parent.embed._rotation=-15
this.parent.embed.text = picText;
this.parent.embed._width=217;
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip(picURL, image_mc);


Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)