Posts Tagged ‘AS3’

Nov 4, 2009

Reducing the drudgery of embedding fonts in AS3

Using and managing embedded fonts in Flash is a lot easier than it was a few years ago, but I still find myself repeating tedious steps of set-up each time I need to create a new font-asset swf.

So, I created an Air application to do it for me ;)

Skip to the end to download the app and source, or read on for all the juicy details...

(more...)

Oct 30, 2009

Something in the air…

Yes, it's close to that time of year again. So here comes the snow...

This requires Flash Player 9.0.124 or greater get it here

The example above (mouse-over to activate) is a Flash 9 example with 1000 blurry snow particles continually falling on random paths. There is also a slightly tweaked version targeting Flash Player 10 (no noticeable performance gains here I'm afraid, just replaced a few Arrays with strictly typed Vectors), and an AS2, Flash 8 version.

The AS2 version can't handle as much snowfall, but the 300 particle example in the source download gives (me) the same processor load as 1000 particles in the AS3 versions (~30% on an old 2GHz pentium, and ~2% on a 2.83GHz Core2Quad)

For speed, I've implemented a linked-list for the particles and there are no transformations on them in motion, except for x/y translation. I'm also pre-drawing and blurring each particle bitmap when the class initialises, then re-cycling them when they leave the snow bounds.

The compiled size of the Snow class is about 4KB for the AS3 versions, and 5KB for the AS2. I've embedded the winter trees image in the examples, so the end file sizes are about 36KB larger than they would be with just the snow.

Feel free to use the code as you want, any feedback or details of how and where you've used it would be great :)

Snow (includes all source files and the example above)

Sep 18, 2009

AS3 Java-style .properties parser

properties

You might be familiar with .properties files if you've worked with ant or Java in general.

If not, in short they're text files containing name-value pairs, usually used for application or build configuration. They allow comments and property values split over multiple lines, with a \ line-end delimiter.

For a recent project I needed to be able to parse, in Flash, .properties files coming from a java-based cms - so made the PropertiesParser.

I'm making it available here, with a small example showing the parsing of a .properties files and reading values from the result.

I hope it comes in useful ;)

Get the code

Mar 30, 2009

FlashPlayer 10 audio fun

spectrumFlow

After seeing these experiments over at everyday flash, I felt compelled to make something using the fp10 version of as3dmod.

(more...)

Dec 9, 2008

AS3 – XML Include…

A while back now I needed to insert data from one xml file to another at runtime (in flash). After a failed search for something that would do it for me (in AS3 at least), I made this...

XIncludeXMLLoader

In the zip there's a FlashDevelop project set up with an example to get you started. There's no documentation at present, but it's fairly straight forward to use.
(more...)

Sep 8, 2008

Developing for FlashPlayer 10?

I've recently been testing out some of the new features available in FlashPlayer 10, building with FlashDevelop+FlexSDK (FD beta8 makes it easy to build for FP10 - yay) and running swfs in the standalone FP10 debug player.

All was well, but I soon found myself maxing out the cpu with some simple audio operations...

After a coule of tests I found the currently available debug players will execute code a lot slower than non-debug players, even hanging or crashing in some cases.

So, use the FP10 release candidate plugin from adobe labs for faster code execution - but no debugging...

Aug 1, 2008

AS3 Design Patterns

I recently stumbled apon this rather useful site - http://www.as3dp.com/ - useful if you're a Actionscript 3.0 developer that is.

"This blog continues the discussion that started with our book; ActionScript 3.0 Design Patterns published by O’Reilly Media. Reusable design patterns are an ideal way to solve common problems in Flash, Flex and AIR applications..."