Sunday, March 23, 2008


View SWF online
Download source
Download SWC

I've been working on this for an entire afternoon.
And's done!!

It's simply a component making usage of the DisplacementMapFilter.
Anytime I want to use this effect, I find it quite painful.
Since I have to recreate every code and elements from scratch.
So I decided to make this into a component.

To use MagnifierFX, all you have to do is drag it out from the component library.
(Be sure to add the SWC file into your Flash's comopnent directory)

There're only four parameters for you to adjust:

1. outerRadius - the outer radius of the magnifier.
2. innerRadius - the inner radius of the magnifier.
(this is quite difficult to explain, actually. just watch the SWF demo above.)

3. strength - how strong this effect is aplied.
4. target - the DisplayObject to be used with this effect
(not that this DisplayObject has to be in the same parent as MagnifierFX)
And remember to call refresh() to redraw the effect by yourself!!
(this is for CPU-efficiency's sake)

1 comment:

JasonT/曾神奇/夜叫獸/逆+/黑框 said...

嘿~ CJ,一直都很佩服你年紀輕輕對as的研究卻這麼透徹,真讓我慚愧阿~不介意的話我想放個連結介紹給朋友. anyway, congrats for having your new blog!