Pop star Taylor Swift plays our game

Taylor SwiftWe were commissioned to create a “Love Calculator” for the BBC back in 2001. The algorithm inside the game accurately mimics a children’s playground game by sorting through the letters in names. The Love Calculator still pulls in traffic to the BBC’s site a whole decade later, and here you can see none other than country/pop star Taylor Swift playing it live on air…[Read on]

addFrameScript method of MovieClip class

Flash timelineMany animations can now be coded, so do not need frames. This means we do not have to associate “pre-filled” symbols in the Library with MovieClips, but can instead associate them with the Sprite class or with our own custom subclasses which extend that class. Sometimes, however, we do need to use the timeline, so must export assets extending the MovieClip class. We can still avoid…[Read on]

Free preloader

PreloaderIn this post we release a Flash preloader component (an SWC file) which is suitable to be dropped on the first frame of any Flash movie and it’ll preload that timeline with precision. There are a few notable things about this preloader which make it worth using. It waits .2 of a second then checks whether more than 95% of the movie has already loaded. If it has, the loader aborts – you…[Read on]

How to use localToGlobal() in ActionScript 3.0

ConfusedlocalToGlobal() in AS3 not working? The LiveDocs on this potentially very useful method, along with its partner globalToLocal() are not actually very helpful. What they don’t make clear is that you need to be sure to overwrite your point when using it. Simply running a localToGlobal() method on a point in a given scope is not enough. You need to write the result back into the…[Read on]

Choosing a Flash video format for pseudostreaming

StarburstWe’ve been spending a lot of time recently examining the different video codecs available for Flash and conducting various tests. Our objective has been to choose the best quality video format which also enables pseudostreaming – without using custom servers such as Lighttpd. Pseudostreaming means imitating the behaviour of a RTMP streaming server such as Red5 or Flash…[Read on]

Passing parameters to a MouseEvent listener

MouseHere is how we construct a MouseEvent handler in ActionScript 3.0… Note that we set the fourth parameter, useWeakReference, to true. This ensures that if this listener is the the only reference to the myButton remaining, myButton can still be garbage collected if required. The trouble with this is that every time myButton is clicked, the same URL will open. We can’t easily pass a…[Read on]

Where to install SWCs for Flash CS4

ComponentsSomething we use here is the Google Maps API for Flash, which is delivered as an SWC file. SWC files are ActionScript classes which have been pre-compiled into an SWF. The fact they are pre-compiled means you don’t have to re-compile them every time you export your application. Another benefit of  SWCs is that they enable you to deliver functionality while keeping your source code…[Read on]

Cannot install Flash Player on Windows?

Flash IconYou’re having trouble installing the Flash Player Active X control on Windows. Every time you run the installer it quits, recommending an Adobe Technote. The trouble is this doesn’t solve the problem either. You’ve uninstalled the previous player, quit all apps, still no joy. In this situation the cause is probably incorrect registry permissions. You can correct this by using Microsoft’s…[Read on]

Why use init methods in AS3?

Init methodsChecking our stats, we noticed that some people are searching for “why use init methods as3″. There are actually several reasons to consider using init methods in AS3 rather than having all of your initialisation code in your constructor functions: Constructor functions run slower than “regular” methods. You might want to re-run initialisation code without recreating the instance.…[Read on]