8Ball: flash.filters.* ?

Sunday 24 October 2004  –  Filed under: Flash  –  No Comments

I had an email conversation today about the ActionScript visible in the demo Kevin Lynch showed in Tokyo this week (which was recorded by Colin Moock). Apparently, there’s a new object named ‘flash.filters’ available in the new Flash Player.

If you haven’t seen the video yet, you can check it out here. As you’ll notice in the video, Kevin shows off some pretty realtime effects which aren’t just fun to look at, but are also drawn 8 to 10 times faster than the current Flash Player possibly could.

Now what’s interesting1 about those lines of code, shown in the demo? Let’s have a closer look at the actual code (thanks to Andy Hall for transcribing):

[as]var filterObj = new flash.filters.DropShadowFilter();
filterObj.blury = undefined;
filterObj.blurx = undefined;
filterObj.knockout = false;
filterObj.inner = false;
filterObj.numIterations = 2;
filterObj.blur = 44;
filterObj.alpha = 100;
filterObj.color = 0×00000000;
filterObj.angle = 36;
filterObj.distance = 11;
loaderClip.filterList = [filterObj];[/as]

There are two interesting lines here, the first and the last.

The first line…

[as]var filterObj = new flash.filters.DropShadowFilter();[/as]

…creates a new instance of a filter named DropShadowFilter, which is part of a package named flash.filters. That would mean that there are more filters available. This can be confirmed by just watching the video, as there are quite a number of different filters being showcased by Kevin.

Another thing that caught my attention, is the package name. Apparently there’s a new top level object named flash. That would suggest that there may be more sub-objects like filters Perhaps there’s another section named flash.effects, which would allow for realtime dynamic effects?

The other interesting line is the last one…

[as]loaderClip.filterList = [filterObj];[/as]

Looks like there’s a new MovieClip property named filterList. This seems to be an array, so that would mean you can stack multiple filters onto a single MovieClip. Interesting, to say the least…

It would be great if the flash package is built into the Flash player, as that would also (albeit slightly) reduce bytecode size when using scriptable, dynamic effects, as there would be no need to include that code in the .swf.

I’m sure everyone’s is anxious to see what else is new, can’t wait to find out more!

« previously: Lost Boys love RIA next: Sequoiaview »


Leave a Reply


Recent Articles

Advertisement

Categories