Adobe Flash

You are here

Programming Finite State Machines in Unity3D using C#

Finite State Machines are quite a convenient design pattern in Game Design, as they allow for quite some flexibility when programming AI behaviour.


Loading External SWF Into Another SWF – And Getting the Movie Clip Out of it

When getting an external SWF using a loader in ActionScript 3, you usually not getting the the MovieClip contained within. Luckily, the loader you used to get the SWF has a property content that contains that movie clip – and with that, also the timeline.

Props to Jonas, who told me that. I just hope I am getting it right here, since I finally didn’t use it in my project …


Getting Things In and Out of Arrays in ActionScript or JavaScript

Since I have a hard time keeping push(), pop(), shift() and unshift() apart, here’s a little cheat sheet I whipped up:

Array Manipulating Cheat Sheet


Dynamically Referencing Variables and Methods in ActionScript

Sometimes, the state of an object decides which method has to be executed. Instead of an unwieldy switch construction like this …

switch (task) {

case "sleep":

case "walk":


… you can use the someObject[someExpression] notation. This works for any object, and you can use it to access both variables and methods. All those lines from above become this: