AS3 Quickie – drawWithQuality()

Since Flash Player 9, we’ve been able to use the BitmapData.draw() method in order to capture visual data from a display object. The major limitation of using this method, is that it will render the visual at the stage quality with which the swf has been embedded/compiled. One trick to get around this is to switch the stage quality on the fly, via ActionScript – yet this is not a supported workflow. With Flash Player 11.3 we have a new method with which to render drawn visuals at any desited stage quality: BitmapData.drawWithQuality(). In the example below, the swf is

Continue reading »

AS3 Quickie – Event.VIDEO_FRAME and Camera.drawToBitmapData()

In the past, if we wanted to copy some data from a camera object to a bitmap, we would need to draw the data from the display object using flash.display.BitmapData.draw() and then manipulate it in some way. This is problematic at times… if there is no way of knowing whether we have valid bitmap data to draw from! Using Flash Player 11.4, we have a number of alternatives to this workflow which allow us to both listen for an event to fire once a frame is available to have its data harvested, and a number of methods from retrieving the

Continue reading »

AS3 Quickie – Attach a Camera to StageVideo

In the past, we’ve been able to attach a local camera to Video display objects within Flash Player with relative ease. The flash.media.Video object, of course, is part of the traditional display list and is not accelerated by the system GPU whatsoever. Using the newer flash.media.StageVideo object, we can implement a GPU-accelerated video display beneath the Flash display list… but previous to Flash Player 11.4 we haven’t been able to attach a camera to StageVideo as we could with Video. Thankfully, now we can! If you have a camera attached to whatever you are using to read this, try out

Continue reading »

AS3 Quickie – Frame Label Events

With Flash Player 11.3 and above, the ability to listen for a frame label event is now included in the runtimes. For example; if you have a MovieClip symbol with a certain set of animation within it, and you have a number of frame labels defined upon the symbol’s timeline… you can now listen for these particular frames through their individual label events and then respond to them in some way. Requires Flash Player 11.3 or above! To get this working only takes a few steps in your ActionScript code. For each frame label you wish to respond to, you

Continue reading »

AS3 Quickie – MouseEvent.RELEASE_OUTSIDE

With Flash Player 11.3 and above, the ability to detect a mouse release outside of embedded Flash content makes a triumphant return! Missing in ActionScript 3.0 from Flash Player 9 onward, crafty developers have come up with some strange hacks to compensate for the missing event – but with the modern Flash Player runtime such trickery is no longer needed :) Requires Flash Player 11.3 or above! To get this working only takes a few steps in your ActionScript code. Everything relies upon classes that already exist – such as flash.events.MouseEvent, but you must target Flash Player 11.3 or above.

Continue reading »

AS3 Quickie – Native Mouse Cursors

We’re looking all the way back to Flash Player 10.2 for a peek at native mouse cursor support! This feature allows us to use bitmap based mouse cursors that run at the OS level rather than inside the display list in Flash Player. Huge performance gains! Requires Flash Player 10.2 or above! It is fairly simple to use a bitmap as a native cursor in Flash Player. We can do so through the [Embed] mechanism: [Embed (source=”AngryFace.png” )] public static const AngryFace:Class; Or by utilizing a bitmap image imported through the Flash Professional Library: Perform the necessary imports: import flash.ui.Mouse;

Continue reading »

AS3 Quickie – “What’s New” Catch-up

For most of my “AS3 Quickie” series, I’ve focused on Flash Player 11.2-11.4, but really have plans to cover all sorts of interesting bits in the recent runtimes – even some additions with Flash Player 10. For those who would like a comprehensive guide to everything new in Flash Player 11 and AIR 3, O’Reilly has published a set of books: “What’s New in Flash Player 11” and “What’s New in Adobe AIR 3“. These books are companion pieces as there is obvious overlap between what is new in each runtime, but are unique enough to require this manner of

Continue reading »