22 December 2006
Written by
Richard Leggett (

)
Published on December 22nd, 2006 @ 11:52:02 am, using 80 words, 557 views
Friends of ED is holding a competition where you could grab the top prize of an Apple Mac Book, 3 FoED books, Camtasia and SnagIT software and a copy of gProject (from gskinner.com). There are also runners up prizes so it's worth having some fun here.
You just need to produce something cool that uses some of the provided assets, it looks pretty open to interpretation, just stick to the rules of coming under 2.5 minutes and 10mb.
Join in here.
Written by
Richard Leggett (

)
Published on December 22nd, 2006 @ 11:30:30 am, using 111 words, 347 views
Scott, Weyert and I are going to be having a Flash Lite Webinar in February, and we'd like your feedback on what you'd like to hear what you'd like to see covered.
To get you started, we have a have a selection of topics listed in the chapter listing (PDF) for the new book, but we'd also like to know whether there is any part of Flash Lite 1.1 or Flash Lite 2.X development that you'd like to hear a bit more about, and whether you'd like to keep things simple, more advanced, or a mixture of the two.
Please drop your comments at the end of this post. All suggestions welcomed.

21 December 2006
Written by
Richard Leggett (

)
Published on December 21st, 2006 @ 10:39:02 pm, using 1142 words, 1172 views
Introduction:
I'm going to keep this very factual. I've been developing Flash for the last 6 years and intend to carry on doing so, as a result I've learned to accept a lot of criticism and be open to review all things new, in effect I'm opening by saying I have not been "bought" as you will no doubt see in this article I aim to give an entirely balanced perspective, the politics interest me not, just the tech. With that in mind, I've been able to get very deep into WPF/E for the last week or so, I've always enjoyed dipping into a brand new tech and getting fully engrossed in it, so it was a nice experience to be given the opportunity (thanks). You may find me making a lot of comparisons to Flash, this is only natural for obvious reasons.
Ok let's start with what it is. It's a browser plug-in for Mac and PC browsers that displays graphics and animations written in XAML, an XML based markup language. To add interactivity and logic, right now you must use JavaScript, and you write that in a typically DHTML way with functions like wpfe.findName() being akin to document.getElementById(). At present the relationship between your markup and JavaScript is achieved by writing the names of javascript functions in your XAML event attributes, for example when an animation completes, or when the user rolls over an element. XAML is the one thing that links WPF/E (codename) with WPF (part of .NET3 and Windows Vista) at present.
The Technology:
Ok so I read online MXML looks like XAML. There's quite a difference here. You can think of XAML more in the vein of SVG with SMIL and interactivity. It is not compiled into a binary, it is indexable in the page by Google if you link to it, or embed it directly in your XHTML page for example. So that leads to both problems and benefits when compared to SWF, it totally depends on the type of content you are creating. It can mean incredibly large files, something that zipping might help, it also means it can be easily generated by a server, and doesn't then need to be compiled before it is viewed. It also makes things like frame based animation difficult, something that binary can do quite efficiently. So points on both sides there.
So that is the presentation layer. Now the logic. You use JavaScript. When I found this out my heart sank a little. Flash developers can be (and I am included here), complete snobs, since we've had a fairly decent language since AS2, with AS3 we have a language to envy, and JavaScript hasn't really changed much over the years, it is stuck at about an ActionScript 0.9 level, in terms of how you have to go about programming with OO in mind, scope chain lookups and the list can go on. I've been lurking around the AJAX developer communities and I am sometimes in awe of how rudimentary the majority of the code is. I imagine there is a going to be a BIG sigh of relief when JavaScript 2.0 proliferates, and rightly so. Still having said this, developing with JavaScript wasn't quite so bad, you can see some of my source later, there are thing you can do to organise yourself a little better, even if you don't have real packages and so on.
Examples:
So here are some examples I've worked on this week. I've also worked up a small library of classes that are useful in not only WPF/E development, but also in JavasScript development in general, for example EventDispatcher, Delegate, and XmlHttpRequestHelper which turns the rather naff XMLHTTPRequest object which AJAX folk love, and makes it into something like LoadVars/XML in AS1 without the XML parsing abilities etc, you still can't get progress out of it though, nonetheless it removes some headaches. I've included full source with all these examples.
http://richardleggett.co.uk/downloads/wpfe/Tests/Tests/
You'll also notice that on that page I've included a couple of techniques that I've picked up over the week.
Conclusion:
This is the real tough one. How can a product that is not even yet 1.0 compete with a product that has been around for 10 years - they'd have to prise Flash from the developers' cold dead hands on the most part. This is key when doing the inevitable and comparing it to Flash, just what is the hard sell that will make me use it over Flash right now - maybe nothing for a lot of people at least with v1. I do see a lot of potential in WPF/E, however, so I should explain this... When Nintendo released the DS and Wii, they had to compete in a world where Playstation and XBox owned all, they simply could not compete in graphical prowess and hardcore budgets, so they didn't, they found a new market in terms of the price point and concentrated on their strengths, the Wii actually re-inventing gaming. So with that analogy in mind, you would be crazy to battle against Flash in the short-term, you need something more tangible...
It is crystal clear that MS are targeting AJAX developers, giving them the tools they want without them having to learn ActionScript or Flash, they are also targeting to some extent two other groups. Designers are key, the Blend and Design tools are being made with these people in mind, I think this is a very tough market to grab, but competition (and of course integration) between the tools of the various proprietors is to be welcomed. The final market is quite obviously people who are already using Windows Media Video, particularly live streaming (i.e. the *other* end of the online video market). These people traditionally use an embedded Windows Media Player in the HTML page which is pretty awful. I heard someone say that if WPF/E means they can make a nice video player for their content, the rest is a bonus.
It is always a time for predictions as we reach the end of a year. So for me 2007 will no doubt see the clash of several new web technologies, maybe the revival of some that have laid low (Java), but all in all this is best for people like you or me who are not afraid of learning something new and bolstering old skills. I'd also like to say goodbye to differentiating between whether something is made in AJAX or Flash, and even if something is a web app, RIA, or desktop application, separating these things into groups is done by people with legacy mind sets, and is a sure way to slow down the rate of advancement in the field of computing. I hope you find the examples and information presented here useful.
14 December 2006
Written by
Richard Leggett (

)
Published on December 14th, 2006 @ 08:52:31 pm, using 137 words, 421 views
It's been a week since I was at Flash on the Beach but whilst I was there Rami Tzabar from the BBC (Digital Planet on Radio 4) asked me a few questions about Flash Lite just after my presentation. You can listen online and download the podcast at:
http://news.bbc.co.uk/2/hi/technology/4849402.stm
Direct link to mp3
Skip to 20 mins 30 seconds for the piece on 10 years of Flash (and Flash on the Beach). The show talks about the evolution of Flash and its expansion into various forms of media. There's also an insightful discussion from Geoff Stearns on the abuse of Flash. 10 years, wow.
Although I didn't have time to prepare, the message is that Flash Lite is an enabling technology that fills a gap in the market, not just competing with an existing product.
11 December 2006
Written by
Richard Leggett (

)
Published on December 11th, 2006 @ 03:11:42 pm, using 91 words, 6375 views
Now that the site is live for our book on Flash Lite (thanks to Scott) I'd also like to take the chance to point you to one of the chapters I wrote which is online for free download, available immediately:
Visit the page (PDF on the right)
This chapter contains a variety of concepts involved with game programming on limited devices; including math, physics, collision detection, keypad input, graphics and sound.
If you enjoy this chapter, please feel free to order a copy from the good people at Friends of ED.
09 December 2006
Written by
Richard Leggett (

)
Published on December 9th, 2006 @ 05:53:55 pm, using 135 words, 418 views
Finally got round to uploading my slides, source and the source for the FOTB Flash Lite Pocket Guide, so my apologies for the delay... I had to take a flight straight from Brighton to Seattle on the last day of the conference and it's been pretty busy since I arrived. I also want to take this chance to thank John, as many others have. It was a fantastic conference and extremely slick, I hope he invites me back next time. Without further ado, here are the zips!
FOTB 06 Complete.zip
If anyone is around Seattle/Redmond in the next couple of weeks and fancies a beer, I'm here till the 22nd so please drop me a comment. I still can't believe how everything manages to be 3 times larger and half the price, how upsetting. 
04 December 2006
Written by
Richard Leggett (

)
Published on December 4th, 2006 @ 07:42:18 am, using 175 words, 706 views
I'm pleased to finally announce the Flash Lite Pocket Guide for Flash on the Beach 2006. I had some problems embedding so many images and a large amount of XML parsing required for something like an event guide in Flash Lite 2, the RAM limitation is something you never totally get used to, but on the flip side I believe that limitations can lead to happiness. There are several tricks and tips required to get this working well, but after some effort here we have it:
SIS Installer (alternatively http://tinyurl.com/y9rsxn)
Zipped up SWF+XML
I'll be uploading the source for this. It is an AS2 Flash Lite 2 project so if you are a Flash Lite 1.1 developer/designer at present, you can see some of the benefits AS2 gives you when creating your mobile apps.
If you are at Flash on the Beach, please do come along to my session on Flash Lite 2 Tuesday at 4:30 in the Corn Exchange.
If you have trouble installing the file, you may like to take a look here.
20 November 2006
Written by
Richard Leggett (

)
Published on November 20th, 2006 @ 09:04:38 am, using 245 words, 491 views
A while ago I posted about casting failing if you cast the result of attachMovie() but only in certain cases.
I had the same thing happen today, so I opened it up in FLASM, and I think I can see what is happening:
push 'sp'
getVariable
trace
push 'sb', 0.0, 'getNextHighestDepth'
callFunction
push 'sb', 'com'
getVariable
push 'domain'
getMember
push 'controls'
getMember
push 'ScrollBar'
getMember
push 'LINKAGE'
getMember
push 3, 'attachMovie'
callFunction
push 1, 'com'
getVariable
push 'domain'
getMember
push 'controls'
getMember
push 'ScrollBar'
callMethod
varEquals
As you can see here, it seems instead of performing a cast operation (and "cast" is a keyword you do see in the FLASM output), it actually tries to perform a conversion (as you see with Array or Boolean), treating com.domain.controls.ScrollPane as a function, and applying it to the result from the attachMovie() operation. This results in the undefined/null value we are experiencing because in itself, this function has no return value unless used with the new keyword as a constructor.
As I stated in the previous post on this subject, splitting the code onto two lines seems to fix the problem (i.e. attachMovie() then cast on the next line). Is this a compiler bug? Has anyone more experience with the inner workings of the Flash Player? Why do Macromedia's v2 components not suffer this, I have a feeling it is to do with the inline dynamic dereferencing, maybe #initclip needs to be brought in for AS2?
14 November 2006
Written by
Richard Leggett (

)
Published on November 14th, 2006 @ 06:42:20 am, using 173 words, 346 views
Well I've seen Tink's and Peter's wishlists, so I think it's time I put up my own, and this was really tricky, too many sessions I'm going to have to sacrifice.
Day 1:
11:00 Craig Swann - ..and now for something completely different..
13:30 Branden Hall - Explorations with ActionScript 3
15:00 Aral Balkan - Memo to the CEO
16:30 Erik Natzke - Keep Interest(ed)
Day 2:
9:30 Brendan Dawes - Contains one scene of sheep skinning
11:00 Joey Lott - ActionScript 3.0 Design Patterns
13:30 Rich Shupe - Vecmaps and Bitters
15:00 Keith Peters - ActionScript 3.0 for Animation
16:30 Richard Leggett - Flash Lite 2 (I'll kill me if I don't go)
Day 3:
09:30 Geoff Stearns - Flash in a Web 2.0 world
11:00 Sascha Wolter - Enterprise Flash
13:30 Hoss Gifford - Creative Evolution: Behind the Scenes
15:00 Chris Curzon - Artificially Intelligent Actionscript
16:30 Mario Klingemann - Mashup Baby!
In other news, there is going to be a Flash Lite guide for FOTB so you can keep track of what is happening, plus a couple of suprise extras. Keep an eye on this blog in the next week.
Things are really hotting up now, excitement levels are running high, so see you there!
11 November 2006
Written by
Richard Leggett (

)
Published on November 11th, 2006 @ 07:51:43 am, using 950 words, 466 views
Aral just had an interesting post on XAML, the markup language used for presentation and layout in Microsoft's Windows Presentation Foundation (WPF). He touches upon a fact that it is sometimes quite a shock to see some real abominations when it comes to some of the XAML out there on the web. But there's more to it than meets the eye when digging deeper. I'd like to post my reply on here also, and make it clear, I am not evangelising for either side in this post, but I find it fascinating comparing these two technologies which are making modern creative development very satisfying....
<snip>
Hey Aral,
Actually I feel I should jump in and balance the arguments a little as a fellow Flash developer. I've been using XAML a lot recently, and it is such a different beast, even though there *are* a lot of parallels throughout the development process, such as timelines, styles, templates (skins), data-binding, partial classes (code behinds), bitmap effects (filters) and so on.
Please ignore the reams of un-readable XAML code out there on the Web. These are auto-generated by designer oriented tools, trust me you can write some really beautiful concise stuff if you *don't* use them. (read: Visual Studio with .NET3 "orcas" add-on if you want to pay, or Visual C# Express with addon if not).
XAML/WPF really does a brilliant job of seperating code from presentation, it positively enforces it in the way you have to work. It takes a little getting used to, true, but for someone like yourself that would be measured in hours not days. It is similar perhaps to DHTML, where the presentation is entirely seperate from the logic. This is shown by the ability to dump all visual content in say the Button class, and replace it with anything you like, it doesn't break because the visual entities are seperate from the Button's behavioural code.
The speed at which you can throw together a simple application is probably the same for both. With XAML you can put anything inside anything inside anything, this makes for some really well encapsulated "cell renderers" without requiring the concept of a cell renderer at all, it's quite clear that the framework is doing an awful lot for you to cater for lots of needs and this has it's ups and downs because it means that your aren't as "pedal to the metal" as with Flash, where we tend to know pretty well what is *actually* happening behind the wizards curtain. As usual with MS we have to rely on the engineers doing a good job on the black box and providing lots and lots of documentation, which they do to a good level.
Where Flex/Flash eases ahead is in terms of visual dynamics and other such nicities. XAML's power comes from the WPF framework behind it. You can literally add tags inside component tags to add borders of all kinds, vector graphics for background etc, dropshadows and other bitmap effects, all conforming to the chosen layout control surrounding them like VBox or Grid. This works great for applications, but if you want some of the things Flash does best, very dynamic animation and small additions here and there you need to jump through the stricter hoops WPF enforces, which means it is much much slower to do certain things and not so easy. Unlike with the Flash Player, being bred as a tool for animation, which enables you to very quickly add dynamism in very little code. This has something to do with the prototype based nature of ActionScript, but more-so the core types built into the player.
This is illustrated by a simple example. I wan't to create a button with 3 states, each looking slightly different visually. In Flash this could not be easier. But in WPF, without an IDE that actually has a concept of these states built in, you must do it in code/XAML only (perhaps also using individual vector/bitmap assets if you want)....
So in Flash it is easy, particularly with slice-9. In XAML/WPF you need to think differently and do this by setting up a new style for all buttons (or just one instance), and then putting in 3 style trigger tags within, one for mouse over, mouse down etc. In those style triggers you can replace the template/skin, or make it highlight/glow etc, it is kind of like modifying CSS on HTML entities using JavaScript on a JS event. So there's a different way of thinking required. But neither is better than the other because they both have so much to offer. The lack of a visual editor acts as a double edged sword. There is a visual editor, but it is only that, you can only create static graphics, the concept of MovieClip does not exist.
At the end of the day penetration stats are going to make the decision for most people, but all in all I thoroughly enjoy using both, and will continue to do so. The Visual Studio IDE makes me a hell of a lot more productive than with any other IDE in any other language. Just being able to use the immediate window (type in any code and it will evaluate it whilst the program is running) and a truly amazing debugger, makes WPF development a joy (roll over objects/arrays in code, have it tree-view that item at runtime). But I'd be saying the same if FlexBuilder had those features, and with the new stuff in AS3 this might possible if the object reflection has come along enough.
</snip>
Comments welcome as always, but please keep them balanced 
19 October 2006
Written by
Richard Leggett (

)
Published on October 19th, 2006 @ 03:05:01 am, using 711 words, 3639 views
A colleague suggested it would be useful to build in version numbers into SWFs so that you could simply right click and see just what version you were looking at. Think in terms of QA or a client on the phone. With continuous integration it is useful to be able to say "hey just right click... so it says r12345?". The r12345 here would refer to the revision number in Subversion. This makes bug tracking say using Trac much more integrated.
Sample (zip at end):
The premise is simple. When you run your ANT build script from Eclipse to compile your SWF, it injects the current revision number into an AS file, which the swf then includes and uses to build a new context menu item containing said revision number. Here's how to do it...
Installation and Pre-requisites:
You will need:
*Be sure you have the LATEST (1.4+) version of Subversion installed, not Tortoise, the Subversion client itself. Download from: http://subversion.tigris.org/project_packages.html
Step 1:
Assuming you already have Eclipse set up. Install svnANT by downloading the zip from the above URL and extracting the following two files:
svnant.jar
svnClientAdapter.jar
...into your ANT lib folder, e.g.:
c:\eclipse\plugins\org.apache.ant_1.6.5\lib
Step 2:
Now before you can use your newly installed svn tasks in build files, you have to make sure these two JAR files are included in your external tool classpath. You can do this by clicking the downward arrow to the right of the External Tools icon that you normally press to run a build ( looks like the little red toolbox with the green icon
).
In the Classpath tab, add the two as external JARs. (see screenshot addSvnAnt.jpg).

(click to enlarge)
The alternative method is to just add the two JARs to your build file's classpath, but this way saves that hassle. But if you do not wish to add these JARs to your ANT you must manually include them on a per instance basis in your ant task with the following line: <taskdef resource="svntask.properties" classpathref="project.classpath"/> where project.classpath is the folder they live in.
Now Restart Eclipse (use -clean flag if you experience problems).
The Build File:
You can now make use of the new tags available to you to perform any Subversion related tasks you wish. The docs are avaible as part of the svnANT download zip. In this case we will get the latest revision number for our src folder and then add that to a file which we can #include which we will include to add our context menu to our base SWF.
Step 3:
In the build file, add another target that looks like this:
<property name="src.revision" value="null" />
<tstamp><format property="today" pattern="d-MMMM-yyyy, hh:mm aa" locale="en"/></tstamp>
<target name="Include_SVN_Revision" >
<svn javahl="false" >
<status path="${main.file}" revisionProperty="src.revision" />
</svn>
<echo>Building revision::::: ${src.revision}</echo>
<copy file="${basedir}/revision_template.as" tofile="${source.dir}/revision.as" overwrite="true" >
<filterset>
<filter token="revision" value="${src.revision}" />
<filter token="timestamp" value="${src.revision}" />
<filter token="user" value="${user.name}" />
</filterset>
</copy>
</target>
( ${main.file} is just an ANT property pointing to your base/application FLA. )
You might just want to look at the build file in the download at the end. Basically all this is doing is injecting some meta data into an ActionScript file which we can later include...
Step 4:
In your FLA (or AS class), you just need to #include the revisions.as file, and add the following code to add the context menu:
var cm:ContextMenu = new ContextMenu();
var revisionCM:ContextMenuItem =
new ContextMenuItem( "r"+_level0.svnRevision, function(){} );
cm.customItems.push( revisionCM );
this.menu = cm;
That's it. Sample should be clearer than the above garb. Here's a sample download and below is a sample swf:
17 October 2006
Written by
Richard Leggett (

)
Published on October 17th, 2006 @ 02:52:44 pm, using 59 words, 451 views
Ms. Dewey makes searching the web a little bit more fun. I tried a search for "Flash" to what she says: "Nothing gets a girl hotter than talking about code. Lights, camera, ActionScript.". The load times seem quite high because of the amount of video used but it might also be a server issue at the moment.
Search now.
Written by
Richard Leggett (

)
Published on October 17th, 2006 @ 01:53:11 pm, using 98 words, 234 views
Next Wednesday (25th Oct '06) my colleague Rob Bateman and buddy Tink will be hosting another LFPUG (London Flash Platform Usergroup). They will be speaking on Visual Interfaces for the Human Brain and Flex 2 for Flash Developers respectively. Tasty stuff. Last time was a lot of fun even though I had to rush off after my preso, but the venue was really nice so hopefully see you there. Remember to sign up to make sure you get in:
Sign up here.
Hopefully this time Stefan (FlashComGuru) will also be able to hook us up with some more live streaming!
Written by
Richard Leggett (

)
Published on October 17th, 2006 @ 03:34:48 am, using 208 words, 247 views
Just got sent this image of last night from a co-worker, Dan Wood. I'm trying to convince Dave Wiltshire on the left of the picture here of my HistoryManager and DeepLink classes in terms of their ability to de-couple views and stop you having to worry about the logic of user journies in your apps/sites.

(Click to enlarge)
It works very simply by giving you a way to initiate navigation requests by user action or direct from the app itself through a central HistoryManager which only your AppController listens to. This means you can do things like automatically generate tracking calls, tie it into the browsers history management etc. On the return journey (acting upon that deep link request) it sets in place a traversal of handleDeepLink() calls down your views so that they can handle the various "levels" in the deep link as they see fit, attaching/removing or loading ContentSections. As an added bonus we can also create RESTful URLs by including parameter notation in any level of the deep link we desire, e.g. "maps|uk|england[x=20,y=50]". This is part of something we are working on, but more of that later.
Dave just now: "Can't we have all documentation like this?" - brilliant 
12 October 2006
Written by
Richard Leggett (

)
Published on October 12th, 2006 @ 03:23:21 pm, using 323 words, 2112 views
So I saw the full-screen video examples the other week using the new Flash 9 update, but the example at the end of this post really pricked my attention.
I went out and got a HD TV a couple of months ago because I figured it was time to make "the leap". As yet I don't think I've made any sort of decent use out of that particular feature apart from watching some Lost s3 over the wifi via a ye olde xbox-1 with media center (convergence is beautiful). Now I'm a firm believer that this whole Blu-Ray, HD-DVD thing is a flash in the pan; a very temporary stop-gap. The last time I bought a physical CD was probably 5 years ago. The last time I bought a DVD, probably a couple of weeks. Why? Because until now only Apple and two companies in the U.S. only have offered full movie downloads in any sort of reasonable, legal manner.
Now we -and it's up to you to define "we"- have pretty much unlimited hard disk space, especially when it is hosted by someone like Google, and of course a fairly fast connection to the internet. So why on Earth are we still buying films on physical media. Apple's solution is ok, but I'm not sure I can access it in the UK yet, regardless the quality is pretty poor at 640x480. So where do we go from here...
I for one would be extremely happy to pay a good price for the latest movies, maybe a flat rate yearly subscription, if they came in the sort of quality that Flash 9 is now offering. Check out this example from Fabio Sonnati for one. No noticeable buffering, glorious high-def fullscreen video. If the rate is low enough, forget hoarding a collection of space hogging DVDs, let's have an enormous collection of online up to date movies to dip into.
Here is that example again (1024 x 576).
30 September 2006
Written by
Richard Leggett (

)
Published on September 30th, 2006 @ 02:08:08 pm, using 57 words, 277 views
Take part in a Flash Lite (and J2ME) contest courtesy of the Mobile & Devices Adobe User Group of Rome and Jamba...

Flashlite category:
• 1st prize: Flash Studio 8
• 2nd prize: IRiver 2G
• 3rd: 3 O’Rilley Books
J2ME Category:
• 1st prize: Nokia N93
• 2nd prize: IRiver 2G
• 3rd prize: 3 O’Rilley Books
Enter the contest here
.
29 September 2006
Written by
Richard Leggett (

)
Published on September 29th, 2006 @ 08:52:05 am, using 335 words, 449 views
I just came across this Doodle Javascript app on MXNA. Mistakenly I said to colleagues, anyone could do that in under a minute in Flash. This was met with the obvious, OK go on then. Instead of getting a really bad looking jagged-lined, clunky drawing tool using 5 Javascript libraries (that don't even work in Safari I am told), you could just plug in 27 very basic lines of code into Flash...
createEmptyMovieClip("bufferMC", 1);
var mousedown = false;
var origX = 0;
var origY = 0;
function onMouseDown() {
origX = _xmouse;
origY = _ymouse;
moveTo(_xmouse, _ymouse);
lineStyle(1, 0, 100);
bufferMC.clear();
mousedown = true;
}
function onMouseUp() {
lineTo(_xmouse, _ymouse);
bufferMC.clear();
mousedown = false;
}
function onMouseMove() {
if (mousedown) {
bufferMC.clear();
bufferMC.lineStyle(1, random(0xFFFFFF), 100);
bufferMC.moveTo(origX, origY);
bufferMC.lineTo(_xmouse, _ymouse);
updateAfterEvent();
}
}
Mouse.addListener(this);
Now I am very much keen to advise using HTML and Javascript when it is the obvious choice. But what gets me is when people go out of their way to make technologies do things that others clearly do a lot more naturally. Hence this blog is HTML, so I always think to myself, choose the right technology for the job and don't create work for yourself! 
As a bonus the fact that Flash is made for this sort of thing brings with it some nice extras, you might notice that with 2 seconds of extra effort here we have the line colour changing as you move until you release, or why not comment out the 3 lines that say bufferMC.clear() and see what you get.
Sample (345 bytes):
26 September 2006
Written by
Richard Leggett (

)
Published on September 26th, 2006 @ 10:50:59 am, using 147 words, 608 views
It's no suprise that smartphones have been rising in popularity in the last few years. I swear by my Nokia for syncing up outlook, contacts, calendars etc, it's great for backup in that respect and work great abroad being mainly tri-band. They are also perfect for Flash Lite development, with the ability to install any version of the player you wish, along with other useful applications like Google Maps. But these phones are so bulky. The N95 seems to be the first to be of reduced size in the last 3 years where the size has remained fairly consistently large since the pocket bursting 7650. Hoping for a bit more to get shaved off in the next wave but I do like the dual-direction slide to make maximum use of the limited space. Did I mention it also has a 5 Mega-pixel camera? 
Pictures and article can be found here.

20 September 2006
Written by
Richard Leggett (

)
Published on September 20th, 2006 @ 02:41:10 pm, using 148 words, 591 views
Just to announce I've uploaded my FlashFoward Austin 2006 slides and source.
You can download the zip here.
As soon as time allows it... a mini-tutorial that goes a little more in depth as to how the multi-user example works and how you can set up SUSHI on your machine (the docs that come with it are great though, so get downloading!
In the meantime, to enable HTTP support in SUSHI, you need to follow the instructions supplied with the SUSHI manual, for example, all I had to do was uncomment this line in my Apache httpd.conf config file:
LoadModule proxy_module modules/mod_proxy.so
...add the following to the end and restart it:
ProxyPreserveHost On
<VirtualHost *:80>
ProxyPass /sushidemo http://127.0.0.1:5556
ProxyPassReverse /sushidemo http://127.0.0.1:5556
</VirtualHost>
Of course 5556 is the port my SUSHI admin.xml configuration file is set to use for HTTP tunneling mode.
08 September 2006
Written by
Richard Leggett (

)
Published on September 8th, 2006 @ 03:40:43 pm, using 311 words, 620 views
A couple of weeks ago we launched several installations in Nike Town, Oxford St., London as part of Nike's Festival of Air, along with the accompanying website. It all kicked off with a fantastic launch party and there was a lot to see and do, I got to meet someone I consider an inspiration in UK hip hop and grime, Dizzy Rascal, and a good time was had all round. But down to the technology...
Two of the things we delivered using a combination of Adobe Flash and some other very custom software and hardware were: a touch sensitive holographic floating shoe (see video on site) and the first part of an interactive event, Ball on Air. With Ball on Air participants register on terminals, kick off their shoes and slip on some Nike Air 360s, then shoot a hoop in front of a high speed camera in an attempt to jump higher than NBA's LeBron James. The software then composes you and ghost you's onto a real world court and measures the height of your jump. Within a minute you appear on the big instore plasma with your name and score for all to see, and you're also on the website for when you get home.

Over the weekend that will switch to the Run on Air event where runners can challenge Paula Radcliff's (unbelievable 12.5mph over 26miles) marathon pace on treadmills, capturing the moment for you to look back at in time to come.
If you are in London this weekend, or any time within the next two weeks, head on down to Nike Town on Oxford St. to enjoy the experience, if not, feel free to catch some of the action in the video on the site. That's all for a week, time to pack my bags for FlashForward, hope to see you there if you are going.
05 September 2006
Written by
Richard Leggett (

)
Published on September 5th, 2006 @ 04:50:58 am, using 321 words, 1001 views
I seem to be getting casting failing (returning null) when I have a class that extends a class that extends MovieClip. Here's an example...
MyWidget extends SimpleButton
SimpleButton extends View
View extends MovieClip
That's the inheritance chain, SimpleButton and View are some base classes I have written for use in various projects and are not part of the v2 components. Here's what happens when I try to cast an attachMovie():
var aWidget:MyWidget = MyWidget( attachMovie( MyWidget.LINKAGE,
"aWidget", getNextHighestDepth() ) );
trace( aWidget ); // null
That should not be happening of course. Now if we change MyWidget to extend View instead of SimpleButton...
var aWidget:MyWidget = MyWidget( attachMovie( MyWidget.LINKAGE,
"aWidget", getNextHighestDepth() ) );
trace( aWidget ); // _level0.blah.aWidget
Now there's nothing wrong with SimpleButton per se, it does this in other situations, with different inheritance chains (and using v2 component architecture), but it does seem to be failing when the chain gets to a certain length.
The quick fix is to return an instance of MovieClip and cast that afterwards (cheers Dan):
var tempMC:MovieClip = attachMovie( MyWidget.LINKAGE, "aWidget",
getNextHighestDepth() );
var aWidget:MyWidget = MyWidget( tempMC );
trace( aWidget ); // _level0.blah.aWidget
I don't remember this happening in the last few years, before Flash 8 and even whilst Flash 8 has been out, yet it has hit a few of us all at once just recently, it's as if some update has been released that causes this behaviour, and I know I've never had this problem before with the same code methodology. Is anyone else experiencing this, or do you have some extra information on why this happens?
29 August 2006
Written by
Richard Leggett (

)
Published on August 29th, 2006 @ 07:03:24 am, using 131 words, 614 views
I was a bit gutted when I upgraded the firmware on my PSP to 2.71 in order to get the Flash Player on there. I had a lot of useful homebrew like a PDF reader and some open source games like Tetris, and its always good to have the choice to try out some demos/games of your own (for example with LUAScript). Anyway some good news and probably the smoothest hack yet. You can now navigate to a special tif image on your memory stick and the preview icon alone will cause the PSP to run in User/Kernal mode all ready for homebrew.
Read more here.
Disclaimer: When I mention "homebrew" I am not refering to pirate material, games or movies, only non-commercial content created by the PSP homebrew community.
28 August 2006
Written by
Richard Leggett (

)
Published on August 28th, 2006 @ 02:20:26 pm, using 129 words, 536 views
"beginner_lite" has been going all out in his spare time adding more and more to the rather expansive Fantasy Quest Flash Lite 1.1 game. Not only is it a role playing game utilizing Final Fantasy graphics if I'm not wrong, but there's also Tetris, Tic Tac Toe, racing, a labrynth, weapon upgrades and a whole lot more packed into this mammoth Flash Lite game.
You can see lots of screens the last few updates to this game over at the Flash Mobile Forum.
As the home page for the Flash Mobile Forum is likely to change frequently, here are the links to the individual entries relating to this game:
11 August 2006
Written by
Richard Leggett (

)
Published on August 11th, 2006 @ 04:54:29 am, using 295 words, 1581 views
I found the Flex 2 docs didn't really contain an example of using the pixel data getPixels() puts into a ByteArray. I wanted to take the pixels in that ByteArray and have them explode or move around in a controlled fashion not obtainable with a simple Convolution Matrix or DisplacementMap.
I'm not going to go through all of that, but just a quick example of getting data back out of a ByteArray and displaying it again as a copy. Normally copyPixels() would be the better option for this specific task, but this as I say gives the opportunity to move the pixels around indepentently in 3D for example.
If you have the Flash 9 preview, you can simple create a movieclip on stage, named mc and put the following code on frame 1:
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.geom.Rectangle;
import flash.utils.ByteArray;
var imageWidth:uint = mc.width;
var imageHeight:uint = mc.height;
var srcBmp:BitmapData = new BitmapData( imageWidth, imageHeight );
srcBmp.draw( mc );
var pixels:ByteArray = srcBmp.getPixels( new Rectangle(0,0,imageWidth,imageHeight) );
var copyBmp:BitmapData = new BitmapData( imageWidth, imageHeight, true );
pixels.position = 0;
for( var i:uint=0; i<imageHeight ; i++ )
{
for( var j:uint=0; j<imageWidth; j++ )
{
copyBmp.setPixel( j, i, pixels.readUnsignedInt() );
}
}
var bmp:Bitmap = new Bitmap( copyBmp );
bmp.x = 100;
addChild( bmp );
Probably the only thing that needs pointing out at all is that you can read out a pixel at a time using ByteArray.readUnsignedInt(), this automatically increments the ByteArray's .position by the required number of bytes. The reason for this is that BitmapData.getPixels() returns a ByteArray of unsigned ints of course (range 0 to 4,294,967,295 - 32bits of data, which allows for the 24-bits of colour, and 8 bits of alpha).
10 August 2006
Written by
Richard Leggett (

)
Published on August 10th, 2006 @ 07:57:43 am, using 117 words, 483 views
The aim of the Y design awards is to recognise leading creative talent demonstrated through the use of digital technology. This year the awards are focussed on the recognition of great design with the use of Flash technology - in celebration of Flash's 10 year anniversary. The competition is aimed specifically at the Uk design/agency community and already there is great interest from some the likes of Saatchi and Tribal DDB. The grand prize, which is a people choice award voted for online, is a trip for the lead designer to the next international Flash conference.
The other nine categories of awards will be decided by a panel of 5 judges including our own Mike Downey.
Visit the website.
Written by
Richard Leggett (

)
Published on August 10th, 2006 @ 04:09:30 am, using 34 words, 311 views
What an awesome suprise when I got to work. For any Little Britain fans out there... "I looove the cake"
Thanks to Robin and to Adobe!


Only problem is it's too nice to eat.
09 August 2006
Written by
Richard Leggett (

)
Published on August 9th, 2006 @ 04:31:53 am, using 249 words, 1132 views
I was just asked by a friend, "if code on the timeline in Flash 8 is no different from AS1 because it isn't inside a class file [therefore not type-checked or anything else that typically differentiates AS2 from AS1], what is AS3 code on the timeline in Flash 9?".
I didn't have a simple answer. That code will still be runtime checked etc, it certainly isn't AS1 or AS2. The reason we can't define what it is exactly is probably due to the nature of the language.
ActionScript has class structures, but they aren't the same behind the scenes as classes in what we call traditional class based languages, they are actually collections of "traits" and "property attributes" on an object prototype. If those terms are new to you, you might find the following paper of interest.
I found this paper quite some time ago probably through MXNA, and it has stuck in my mind since I first read it, it gave me a much better understanding of how a prototype language is very different to anything else, and how that makes it very suitable for GUIs which is the subject of the article.
It's a bit old, but 100% worth the read.
http://waltersmith.us/wp-content/uploads/2005/12/OOPSLA95.pdf
That paper doesn't really get technical enough, but there's a lot more info on this matter in the LiveDocs which directly related to ActionScript. The pages in that particular LiveDoc are really good reading if you like to look behind the curtain.
22 July 2006
Written by
Richard Leggett (

)
Published on July 22nd, 2006 @ 05:48:07 am, using 216 words, 291 views
Come and join us this time at my place of work for the July London Flash Platform Usergroup (LFPUG) meeting for some really great presentations, and of course free beer and pizza. Covered this month:
Development Techniques for Localizing Flash (19:00 - 20:00) - Dave Williamson
There is no avoiding it. More and more projects require some level of localisation. Clients want their micro site deployed across Europe, banners to support the whole of EMEA, and global intranet applications that take in the whole of the planet. Not only that they want them built to the same timelines as their HTML emails. Find out the easiest tricks to make those hellish localisation issues…… not so hellish.
Introduction to Flash 9 (20:15 - 21:15) - Tink
Flash 9 ActionScript 3.0 Preview is now on labs to owners of a valid serial number for Flash 8 Professional and Studio 8. Available to provide access to ActionScript 3.0 for Flash 8 users, and scheduled for release 2007, we’ll take an early look at the new IDE features for publishing ActionScript 3.0 content to Flash Player 9.
Details:
Time: 19:00 - 21:30 (doors open at 18:30)
Venue: AKQA, 1 St. John’s Lane, EC1M 4BL (click for map)
Nearest Tube: Farringdon
Sponsored and hosted by AKQA
Prizes for the free raffle
1. 6 copies of Computer Arts - donated by Computer Arts
2. 6 Flex 2.0 API Visual Reference Posters donated by RocketBoots.
Sign up to attend!
14 July 2006
Written by
Richard Leggett (

)
Published on July 14th, 2006 @ 03:15:09 pm, using 331 words, 446 views
Time to catch up. I've been at AKQA for a little while now and I've enjoyed it thoroughly so far and I really feel a strong commitment to the team. My first project went live the other day, www.nikerunning.com, even though it's aimed at runners (of course!) I hope you enjoy it even if you are not. My favourite sections are the shoe selector and technology section. I'm no photographer, but after this I've started to appreciate good photos; you can hit the home button to get 3 different scenes for the home page, I wish I'd gone on shoot for the coastal one!
The site went unexpectedly smoothly (for a Flash project!), so I have to thank the creative team because they are truly superb. This time round I took some time to write a mini component set that the whole thing is based on, I find that Flash sites like this are on the whole very creatively driven and without a pretty flexible base to build on you can find you need to start hacking things to do things they weren't thought out to do originally (which is understandable). Basically I wanted to make sure that anything that was going to go wrong was going to be through fault of my own.
I've also finally come to find a nice architecture for Flash 8 (or lower) projects, perhaps even an AS3 only Flash 9 project that seems to handle all of the expectations we now have with "experience" sites. Some of these expectations include integration with the back/forward browser buttons (including deep links to sections and products), localising every aspect of the site from the menu structure to the copy and content contained within the site and as much as possible future proofing the site for upcoming phases throughout it's lifetime.
Time to get back to the grind, hope to hear any suggestions from runners or fellow Flashers on what we could do to improve the site moving forward.
Written by
Richard Leggett (

)
Published on July 14th, 2006 @ 07:49:28 am, using 154 words, 321 views
Well, I've been using Zinc for quite some time now so I know it pretty well and I'm very keen to give the new version a test run and see that any old bugs have been quashed forever, so here's a thank you to MDM for the free copy. 
Zinc 2.5 now supports Flash 9 (which includes AS3 and Flex 2 apps), I'm yet to look into how this is implemented, but with 2.5 we saw the commands becoming synchronous, which was a big relief from the asynchronous commands we had in all the swf wrappers a little while back. Also bundled for the first time is an SWC, this should also mean intrinsics for all of the classes (previously intrinsics were downloadable seperately and were a lone effort by one of the team in the forum), this should ultimately keep FDT/Flex Builder 2 happy.
If you'd like to read more about Zinc 2.5 check out the press release.
03 July 2006
Written by
Richard Leggett (

)
Published on July 3rd, 2006 @ 03:52:01 am, using 116 words, 1678 views
Just a quick warning to people using ExternalInterface. When you are calling Javascript functions that open new windows your Flash movie will lose all mouse interaction (no rollovers etc) and the button you pressed to open the popup will stick on its "over" state. This is only in Firefox, (and possibly only when the popup contains a Flash movie, tbc).
Other than that ExternalInterface has been performing superbly, it greatly simplifies the communication between Flash and Javascript and works very well with unFocus HistoryKeeper (for back/forward button nav in browser).
It's a shame this behaviour is exibited in Firefox, but the solution is very simple, trusty old getURL( "javscript:funcName( "); in this one special case.
01 July 2006
Written by
Richard Leggett (

)
Published on July 1st, 2006 @ 09:13:17 am, using 127 words, 329 views
Hot on the heels of my last post (it's been a busy month so my lack of posts is showing!) I'd like to announce I'll be presenting at the first Flash on the Beach, I believe this is the first UK exclusive Flash event in 6 years, and it's high time so thanks to John Davey for organising it. Flash on the Beach runs from Dec 4,5 & 6th and takes place of course in what seems to be the place to be right now, Brighton! I've actually never been to Brighton but it definitely has its fair share of great Flash devs so what better place. My topic is yet to be confirmed but you can be sure the words mobile and Flash are in there!
There's a running till the end of July so head over there now and book your place! Now back to the England match!
Written by
Richard Leggett (

)
Published on July 1st, 2006 @ 02:11:42 am, using 140 words, 330 views
I'm very pleased to announce I'll be presenting at Flash Forward Austin in September. I've only been across the Atlantic once to visit Chicago, so I cannot wait to check out Austin especially with the City Limits festival straight after the conference. I will be presenting on my favourite topic, Flash Lite (2). Hopefully you've already clicked the link above to check out the lineup, all I can say is that I'm going to enjoy going to the other presentations as much as giving mine
and the conference runs from the 16th to the 18th.
Hope to see you there, and feel free to drop me an email to the address on the right if you have any questions or would just like to say hi!
(Apologies if you get this as a repost, post was deleted when pruning comment spam.)
26 June 2006
Written by
Richard Leggett (

)
Published on June 26th, 2006 @ 01:32:47 pm, using 88 words, 2679 views
This is cool, Hayden Porter on the Flash Lite Yahoo Group just posted the following link to a blog that is reviewing Flash games for PSP on a weekly basis. PSP Homebrew has been seriously hampered by the last few updates, with no real mod-chip out there yet, it's been the case that homebrew is for the hardcore (even I upgraded so I could play the latest games). Either way, Flash for PSP fills some of that void with free games to download:
Check out the blog here.
13 June 2006
Written by
Richard Leggett (

)
Published on June 13th, 2006 @ 07:31:00 am, using 89 words, 371 views
Tink has just posted the details on the first meeting of the London Flash Platform User Group. This is a group in addition (and not a replacement for) to the LMMUG, focussing on Flash Platform technologies exclusively, including Flash, Flex, Apollo, Flash Lite and more!
Topics will include Flash Media Server, with FlashCommGuru Stefan Richter, and Ruby On Rails for the Flex Developer, with Stuart Eccles. Both of which are fantastic topics to start with and I'm sure of interest to you as a Flash Developer!
See you there!
11 June 2006
Written by
Richard Leggett (

)
Published on June 11th, 2006 @ 09:17:00 am, using 339 words, 407 views
Do you regularly back up your computer files, code etc? I used to do the usual, which involved sporadically dumping what I thought was important to DVD once a month maybe. Thankfully I've only encountered a real problem where I lost work that I hadn't backed up just once, SVN came to the rescue in this case, but I vowed never to lose work again because of poor backup procedures.
So a couple of months back I put together an external HD, from a 200gig internal 3.5" drive and a USB 2.0 fan assisted cradle from eBay. This seemed to be to be not only a low cost approach but also hot-swappable when it comes to backing up the backups onto more than 1 drive. So with the hardware sorted I shopped around for a software backup solution to replace my not-so-great xcopy batch file.
I found Allway Sync offered a free version, and when it comes to products you really need to test thoroughly before you buy, their free version had very few limits, just the amount you backup each month. So two months later I've decided it does a fantastic job of going through and synchronising (pc-drive, drive-pc, or both-ways) whichever folders I've specified with exclusion rules to match and gone ahead and purchased it for the measely sum of just under $20, which is $10 less than usual right now. So with a single click I now backup My Documents, Projects, Outlook PSTs and many more folders with just the one click. Definitely 8 or 9 out of 10 for this product.
Another product that recently came to my attention was the $5 a month, unlimited online backup solution provided by Carbonite. This looks like a perfect companion to my local backup procedure in order to give me that off-site peace of mind. Carbonite runs as a system process, constantly backing up your HD changes to the Carbonite servers whilst attempting to utilise the minimum processing power and bandwidth when you are using your computer.
What is your backup process, do you recommend any alternatives?
09 June 2006
Written by
Richard Leggett (

)
Published on June 9th, 2006 @ 08:08:52 am, using 161 words, 1160 views
Couple of things just brought to my attention. The first is the ridiculous COPE Act. To summarise:
"The COPE Act, which give big companies like AT&T, Verizon, and Comcast the ability to throttle bandwidth for sites who don’t pay their extortion fees."
The second was just now when a MSN (Windows Live) Messenger contact told me that he was informed that I had "become active". I don't have any plug-ins, and all I did was return to lunch and move my mouse. I think the new version of MSN/WLM informs your contacts who have preivously had a message window open that you have returned to your computer. There's no privacy option to allow me to disable this as far as I can tell. Anyone have any knowledge of this?
Not wanting to over-dramatise, these sorts of things make me feel like I'm in 1984. Not to mention the pay-per-view real life TV security cam-channel in my local area.
01 June 2006
Written by
Richard Leggett (

)
Published on June 1st, 2006 @ 02:46:51 am, using 99 words, 967 views
Mobile Search is expected to be available in the standard sales packs of Nokia N73, Nokia N93, Nokia 6630, Nokia 6680 and Nokia 6681, and in select markets in the standard sales packs of Nokia N70 and N71. It is also offered as a free download for additional Nokia S60 devices from www.nokia.com/mobilesearch.</em>
I noticed it has Yell.com search and shows the results on a map which is a nice touch. I'm sure a US rollout will follow suit. For now you can head on over to the site below to download it free:
http://mobilesearch.nokia.com/
24 May 2006
Written by
Richard Leggett (

)
Published on May 24th, 2006 @ 02:17:35 am, using 84 words, 514 views
Just a quick shout out to those of you going to Adobe Live tonight at Olympia 2 in London. I'll be there, somewhere about the London MMUG stand most likely so please do say hi. Our creative development director Andy Hood will be on the panel on "The future of the Internet as an Applications Platform" along with Aral, Ben Watson and Andrew Shorten (Adobe), Bola Rotibi (Ovum) and James Govenor (Redmonk). Hopefully the web-site is still accepting registrations for the event.
See you there.
Written by
Richard Leggett (

)
Published on May 24th, 2006 @ 02:07:22 am, using 165 words, 728 views
Nokia releases 'Web Browser for S60' engine code to open source community
Nokia's series 60 browser is pretty damn good, and I'm not just saying that because it includes the Flash Lite player 
Nokia's recently launched Web Browser for S60 enables full mobile browsing of complete web pages as they exist on the Internet, leveraging compatibility with AJAX technologies and support for dynamic HTML and scripting language. The release of source code for the S60 Webkit browser engine, based on WebCore and JavaScriptCore components of Apple's award-winning Safari browser, will be accompanied by Nokia's active participation with the open source community in developing further enhancements to the browser, sharing changes to the core browser engine as they are made in real time.
Of course the Flash Player inclusion is dependant on the handset in question, and won't be part of the open-source effort, but this is still a fantastic move by Nokia to improve the mobile browsing experience.
You can read more information on this here.
22 May 2006
Written by
Richard Leggett (

)
Published on May 22nd, 2006 @ 05:28:01 am, using 151 words, 1097 views
Two new white-papers just went live over on Nokia Forum. The first is "Flash Lite: Visual Guide":
"This document describes how to develop usable S60 Mobile Flash user interfaces that take the best out of the possibilities that Flash Lite offers. Also other factors that affect the total user experience of Flash Lite applications, such as performance, are shortly explained."
Download it here
The second is aimed at a business audience, "Flash Lite for S60 - an emerging global ecosystem":
"This white paper provides an insight into Flash Lite and the work under way to introduce the technology to the S60 platform. The document provides an overview of the technology, discusses the business potential for its rapid adoption, and introduces deployment and integration of the technology into S60 devices. The document also contains examples of how the technology is used and a summary of the Flash Lite development process."
Download it here