Category Archives: Tutorials

JavaScript for Flashers Part 1: SWFObject

As fantastic as Flash is, it can’t do everything; sometimes we need to use other technologies to get results. For Flash running in a browser, JavaScript is a useful (and sometimes essential) tool.

I categorise my use of JavaScript into three areas: 1. Essential: embedding Flash in HTML (and providing alternative content), 2. Semi-essential: deep-linking (using browser back/next buttons for Flash navigation) and 3. Optional: everything else. I will cover 2 & 3 in later posts, but first…
Continue reading

Drawing Bezier Curves

For the un-initiated, Bezier Curves are curves defined by a set of (at least 2) points in space (usually defined by x and y coordinates). By setting appropriate sets of points, complex curving paths can easily be defined. These could be simply drawn to the screen or used as paths for visual objects (eg a game character) to follow.

The simplest case is a curve defined by 2 points – which is just a straight line. As more points are added the curvature can become more complex. The curveTo method of the Graphics class uses a Bezier Curve of 3 points (1 point defined by the current drawing position and 2 points passed into the method).

So, if we want to draw a 2 or 3 point Bezier Curve, Flash can do the work for us, but for 4 points or more we need to handle it ourselves. Also, if we are using a Bezier Curve as a path for an object to follow, we need to know the coordinates at all positions along the path and the drawing methods of Flash wont help us with that.
Continue reading

Beep And Other Sounds Part 1

If you are an old codger like me, you will (fondly?) remember the sounds of early computer games. They were mostly monotone beeps and bips, but there were some real gems that took the audio experience seriously (think Defender) and used the simple audio abilities in more interesting ways.

Now, just 30 years later, Flash can also generate it’s own sound…
Continue reading