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.

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.

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.

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.

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.

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. :p

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.

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?

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!

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 ;)