Accessibility
Elad Elrom

Elad Elrom

elromdesign.com/blog

Table of Contents

Created:
14 September 2009
User Level:
Intermediate
Products:
Flex

Using Pixel Bender with Flash Builder 4 beta as a number crunching engine

Featured in Flash Player 10, Adobe Pixel Bender technology was designed to manipulate pixels, but it can also be used as a multi-threaded number crunching engine. You can pass in a list of numbers, and have Pixel Bender perform complex mathematical operations and then return a list of results.

Why would you want to use Pixel Bender for calculations? The short answer is that it improves performance. ActionScript runs as a single thread, so while Flash Player is processing information, it cannot run another thread to do something else. If you need to do some heavy lifting—such as a long series of complex calculations—Flash Player may appear to be stuck until the calculation is complete. With Pixel Bender you can run 32-bit floating point calculations on a separate thread (on another processor core if available) and process the results when they are complete, leaving the main thread to continue unimpeded.

In this article, I will discuss how to use Pixel Bender for calculations and show you how to build a real-life number crunching application with Pixel Bender.

Requirements

In order to make the most of this article, you need the following software and files:

Pixel Bender Toolkit

Flash Player 10

Flash Builder 4 beta

Note: It is possible to use Pixel Bender with Flex Builder or the Flex SDK; however, the examples in this tutorial are built with Flash Builder 4 beta.

Prerequisite knowledge

To build the examples described in this tutorial you need to know how to compile Flex applications using Flex Builder or the Flex SDK.

About the author

Elad Elrom is a technical writer, technical lead, and senior Flash engineer. As a technical writer, Elad wrote books covering Flash technologies. He maintains an active blog and has spoken at several conferences regarding the Flash platform. He has helped companies follow the XP and Scrum methodologies to implement popular frameworks, optimize and automate built processors and code review, and follow best practices. Elad has consulted a variety of clients in different fields and sizes, from large corporations such as Viacom, NBC Universal, and Weight Watchers to startups such as MotionBox.com and KickApps.com.