Mike Chambers

code = joy

Archive for the ‘ActionScript’ Category

FITC Amsterdam : Building High Performance iPhone Applications with ActionScript 3

with 2 comments

Sorry for the two month hiatus on posting. I was on a sabbatical and vacation from work for the last 6 weeks of 2009, and have spent the first couple of weeks of 2010 busy working on code, and preparing some events for the spring (more on that in another post).

Some of the stuff I have continued to spend a lot of time working on, has been building iPhone content using the Flash CS5 private beta. I have been doing a lot of work on trying to figure out how to get the best performance, and understand the limits of Flash content on the device. I plan to make a separate post on that in the next couple of days.
Read the rest of this entry »

Written by mikechambers

January 25th, 2010 at 10:13 am

Case Study : ActionScript 3 Performance Optimization

with 23 comments

Prompted by some of the work from Grant Skinner (in particular his FOTB 2009 session) and Thibault Imbert, I have been doing a lot of research lately into optimizing ActionScript 3 content. Not just how to make it run faster, but how to approach the process of optimization.

I am also starting to work on a small project which works with pixel data from images, and on which I anticipate performance might be an issue when working with larger images. I figured this would be a good opportunity to use some of the early code as a case study. I wanted to post the process and results here.
Read the rest of this entry »

Written by mikechambers

October 13th, 2009 at 10:27 am

Posted in ActionScript

Tagged with , ,

Parsing and displaying BMP files via ActionScript

with 13 comments

I dont have a formal computer science training / education, so I never got the chance to learn about working with low level data structures (bits and bytes). I have wanted to learn this for some time, but had difficulty finding resources for it which didnt assume I had a computer science degree.

Well, yesterday, FITC posted all of the video sessions from FITC Toronto, and I spent some time watching Lee Brimelow’s presentation on working with ByteArrays. It is a really great session, that provides a clear and solid foundation and understanding of working with ByteArrays and bits and bytes.

Anyways, after watching Lee’s session, it all finally clicked for me, and I spent some time last night putting together a simple parser that would dynamically load and display a 24Bit BMP image file within Flash.
Read the rest of this entry »

Written by mikechambers

September 17th, 2009 at 2:32 pm

Posted in ActionScript,General

Tagged with ,

Converting from Matrix3D to Matrix in ActionScript 3

with 8 comments

For the past month or two, I have been spending time building a game (something I havent done since my Flash 4 days). This has really been a lot of fun, as it has allowed me to use some of the Flash Player APIs which I really haven’t had a chance or need to use before.

One thing which I have been (slowly) learning about are using Matrix transformations on DisplayObjects. I made a post earlier showing how (with much, much help from Senocular), I was able to use Matrix to do hit tests using BitmapData.hitTest on DisplayObjects which have had transformations applied to them (in this case, rotation).

Well, I recently had the need to convert some of my DisplayObjects to use the 2.5D APIs (by setting the z property to a value). Unfortunately, this ended up breaking a lot of my code, mostly because of how it changes how transformations are applied to a DisplayObject. Specifically, when you set the DisplayObject.z property to any value, DisplayObject.transform.matrix will return null, and you must use DisplayObject.transform.matrix3D instead. Where this causes problems is when you are using APIs that expect to use a Matrix instance, as opposed to Matrix3D instance, such as BitmapData.draw.
Read the rest of this entry »

Written by mikechambers

September 9th, 2009 at 10:48 am

Posted in ActionScript

What new game APIs do you want in the Flash Player?

with 92 comments

I have been learning some game development lately, and building my first game (well, at least my first game since Flash 4). I think game development and deployment are some of the real strengths of the Flash player, but ones which we haven’t specifically focused on in a while.

While working on my game, there were a couple of things I needed to do where additional player APIs could have made the development easier (as well as likely speeding up execution). This got me to thinking about other APIs that would be useful for game development. So, what new Flash Player APIs would you like to see that would make game development easier?

Here are a couple from me:
Read the rest of this entry »

Written by mikechambers

June 16th, 2009 at 12:03 pm

Posted in ActionScript

Tagged with , ,

Update to JSON support in as3corelib

without comments

Darron Schall has just checked in some changes and bug fixes to the JSON support in as3corelib. Among other things, Darron has added a strict mode which allows you to specify how strict of a conformance to the JSON spec you want the library to follow.
Read the rest of this entry »

Written by mikechambers

December 23rd, 2008 at 12:55 pm

Posted in ActionScript

Tagged with ,

Adobe drops restrictions on SWF, FLV formats

with 2 comments

As you have probably seen, Adobe has dropped the licensing restrictions on both the SWF and FLV file formats. Among other things, you can know use the formats to create players that read in the formats.

Check out Ryan Stewart’s weblog for more discussion

We have also put up a site with some information, which includes a FAQ.

You can also download the specs:

Written by mikechambers

May 1st, 2008 at 8:34 am

Posted in ActionScript

Tagged with

initializing for loop counter outside of loop in ActionScript

with 8 comments

Continuing my series of posts of interesting, but not too useful ActionScript tips (which I learned from studying Objective-C), did you know that you dont have to initialize your counter variable within a for loop.

For example, this is perfectly valid:
Read the rest of this entry »

Written by mikechambers

October 23rd, 2007 at 11:43 pm

Posted in ActionScript

Using Bitwise XOR to exchange variable values in ActionScript

with 13 comments

I have been studying some Objective-C in my spare time, and was reading up on Bitwise operators tonight. I came across a simple way to exchange the value of two variables using the Exclusive-OR (XOR) operator that doesn’t require creating a temporary variable.

Normally, if you wanted to exchange the value of two variables, you would have to create a temp variable to store values temporarily (which uses additional memory). For example:
Read the rest of this entry »

Written by mikechambers

October 22nd, 2007 at 9:57 pm

Posted in ActionScript

Handling Flash File Uploads with .NET

with 2 comments

Denis Sosnovtsev has posted a really useful blog post over on the atellis labs site. The post shows how to upload files from Flash to a .NET backend. The example includes both ActionScript and .NET / C# code snippets.

You can view the entire post here.

You can also view Mark Piller’s session from the on AIR Bus tour on integrating .NET with Adobe AIR applications.

Know any other good ActionScript / .NET resources and tutorials? Post them in the comments.

Written by mikechambers

August 6th, 2007 at 6:51 pm