Wednesday, January 30, 2008

Smooth Imported Image

This is code that allows an imported image via getMovie to be smoothed. I got it here.

--------

_global.smoothImageLoad = function(imgURL, targetMovie) {
var i=0
do { i++ } while (eval("_root.smoothImageLoadTemp"+i) != undefined)
tmc = _root.createEmptyMovieClip("smoothImageLoadTemp"+i, _root.getNextHighestDepth())
tmc.createEmptyMovieClip("ti", tmc.getNextHighestDepth())
tmc.tm = targetMovie
with(tmc) {
tmcl = new MovieClipLoader()
tmcl.onLoadComplete = function() {
ti.onEnterFrame = function() {
pixelData = new flash.display.BitmapData(ti._width, ti._height);
pixelData.draw(ti);
tm.attachBitmap(pixelData, 1, true, true);
tm.smoothImageLoadComplete()
removeMovieClip(ti._parent)
}
}
tmcl.loadClip(imgURL, tmc.ti)
}
}

--------

smoothImageLoad("image.jpg", mytargetmc)

Tuesday, January 29, 2008

Perspective Skew by Eric Lin

So the site says it's not "true" perspective but honestly, who cares. The effect is believable enough.



You can read more about it and download the FLA on his page.