Not yet rated

Problem

What's the best way to load and apply a Pixel Bender filter to video during playback?

Solution

You can attach a Pixel Bender filter to any Display Object in Flash

Detailed explanation

The Flash Video object has a filters array property that you can just add a Pixel Bender filter to just as you would an image or movie clip.

If you look at the inherited properties for the video object in ActionScript 3

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Video.html#propertySummary

you'll see the filters property. You can add a Pixel Bender filter to that array:

var shader:Shader = new Shader( 
<byte array of Pixel Bender bytecode that was embedded or

loaded>
); var shaderFilter:ShaderFilter = new ShaderFilter( shader ); videoObject.filters = [ shaderFilter ];

+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes