When you request a
Context3D you’ll either get the requested profile or software rendering. But what if you’d rather fall back to a lesser hardware context? What if your app can make use of the regular/baseline profile but can run with reduced graphical effects using the constrained mode profile? Today’s article presents a utility class that makes it a snap to always get the best
Context3D that Flash Player can give you.
When you request a
AS3 has never had very good support for multi-line strings… until now. Today’s article discusses the proper and improper ways of writing multi-line strings and delves into the bytecode so you really understand what’s going on.
The last article gave a very basic example of the
flash.concurrent.Condition class introduced in Flash Player 11.5. That example was (hopefully) a simple and easy way to understand the mechanics of how the
Condition class works. Unfortunately, it was not a useful example and actually demonstrated the opposite of what you’d want to use it for. Today’s article shows a somewhat more complicated example that should serve as an example of appropriate usage for
Condition class that debuted alongside the
Mutex class in Flash Player 11.5 is very useful but much less understood. Unfortunately, Adobe’s documentation doesn’t include a usage example and there seem to be none available elsewhere on the internet. So today’s article provides an example of how to use the
In the last article we learned that a
ByteArray shared between two workers also shares its
length field but not its
position field. This raises a followup question: what about when the length changes? Today’s article sees what happens when you change the length of a
ByteArray that is shared between two ActionScript workers to see just how shared that
length field really is.
ActionScript workers allow you to take advantage of today’s multi-core processors by creating multiple threads of execution. These threads will invariably need to share some data between them. By default, all data passed between the workers/threads is copied, which can be really slow. The
ByteArray class can be shared without copying. Today’s article discusses this and talks about some quirks that come along with it.
assert function is found in many languages to provide a way for you to check for errors only in debug builds of your code. For release/production builds, the asserts are removed to make the compiled code smaller and remove all of the overhead of the error checking. Flash doesn’t come with such a feature built-in, but can we build one ourselves? Today’s article will try to do just that using nothing but Adobe’s modern AS3 compiler: ASC 2.0.
While ActionScript Workers made their debut in Flash Player 11.4, the
Mutex class didn’t arrive until the next version: 11.5. This class is specifically designed to solve a subtle problem that cropped up in the last article. As you’ll see in this article, it does the job quite well! The result is even faster message passing between workers/threads, which is often key to efficiently using multiple core CPUs.