Dynamic Flash

Confessions of a serial code abuser
  • rss
  • Home
  • MTASC
  • Archives
  • About me
  • Goodies
    • Base64 encoder/decoder class
  • My Bookshelf
  • My Talks

Moving on

Monday, 26 October 2009

I’ve been putting off writing this blog post for a long time. However, this blog is beginning to look neglected and now is as good a time as any for me to explain why I am moving on from Flash / Flex development.

Of course, when I say “I am moving on”, what I really mean to say is “I have moved on”, something my friends and colleagues realised way before I did. I was hired into Yahoo! as a Flash specialist web developer, but during my three years working for the big purple I’ve done precious little Flash work. I now find myself in an architecture role, where I’m predominantly dealing with standards-based technologies and languages, and there’s only so much room in my head and something had to give.

There are countless blog posts I’ve not written because they are not suitable for posting on a site called Dynamic Flash. I will be setting up a new blog at the ironically-named statichtml.com where I’ll be posting semi-regularly on my battles with HTML, CSS, JavaScript and general development principles. I will keep this site running for as long as people find the resources on it useful, and may even post from time to time when I find something interesting to talk about, but I will be shifting the majority of my attention elsewhere.

Over the years I have learned a tremendous amount from the Flash Platform community. I started way back in the Flash 4 days asking questions on the FlashKit and WereHere forums. As a C/C++ developer the world of Flash development was entirely alien to me, especially with the rudimentary scripting language we were stuck with back then; it lightyears away from the mature and fully-featured ActionScript 3.0 language we have today. After finding my feet and answering a bunch of questions myself, I ended up as a moderator on FlashKit in the Scripting & Backend forum. I was a student at the time as so had plenty of time to spare, and spent countless hours answering questions and looking after my little corner of the FlashKit community.

From my work on FlashKit forums I was approached by Friends of Ed to contribute a couple of chapters on PHP and MySQL to their Flash 5 Dynamic Content Studio book. I jumped at the opportunity, and went on to write or contribute towards a dozen or more books on Flash and web development. None of them brought me the fame and fortune I was imagining when I signed my first contract, but it did help to pay the bills and I had a tremendous amount of fun helping people learn new things. It’s one of the most rewarding things I’ve ever done, and I’d recommend it to anyone that gets a kick out of teaching. Just don’t do it for the money :)

It’s been a blast, and I’ve met some great people and made some really good friends along the way. I owe the Flash community a debt of gratitude for helping me to learn and grow as a developer. I can only hope that with this blog and through my books I have repaid at least part of that debt.

Comments
4 Comments »
Categories
General
Comments rss Comments rss
Trackback Trackback

iPhone / iPod Touch Development Resources

Monday, 26 January 2009

Long time subscribers may have noticed that it’s been a little quiet around here of late. That’s because I’ve been spending less time tinkering with Flash / Flex / AIR and more time getting serious about iPhone / iPod Touch application development. I’ve got one completed application pending approval from Apple, and another two in the works, all of which will be published under my new tapjunkie brand and documented on the site once they’re available.

The iPhone SDK has only been generally available for 6 months or so, and the community is still finding its feet. Consequently it can be hard to hunt out the really good resources. Since I’ve been looking for an excuse to write another blog post, I figured I’d post links to a bunch of resources that I’ve found helpful in getting started with iPhone development.

The single best resource I’ve found thus far is iphonedevsdk.com, which is a collection of forums for iPhone application and game developers. There are lots of these kinds of forums knocking around, but this one has an active community and is one of the few I’ve had consistently useful advise from.

Book wise I have a copy of Beginning iPhone Development by Dave Mark and Jeff LaMarche, which is excellent, and I’m planning to pick up Erica Sudan’s The iPhone Developer’s Cookbook sometime this month as a good follow-up book. You might also want to grab a copy of Learn Objective–C on the Mac by Mark Dalrymple and Scott Knaster to help you get familiar with the Objective-C programming language.

Finally, I’m subscribed to the following blogs:

  • iPhone Development (Jeff LaMarche)
  • iPhone SDK Articles
  • Cocoa with Love (Matt Gallagher)
  • iPhone Developer Tips
  • iCodeBlog
  • atebits blog (Tweetie developer)
  • Diary of a Graphics programmer
  • Hand Circus (Rolando developer)

As an added bonus, our very own Keith Peters has published a series of iPhone development articles covering (as you might expect) physics-based animation. These are particularly useful if you’re looking to translate your ActionScript skills into Objective-C as Keith does a good job of explaining the latter in terms of the former:

  • Gravity Tutorial for iPhone – Part 1
  • Gravity Tutorial for iPhone – Part 2
  • Gravity Tutorial for iPhone – Part 3
  • Gravity Tutorial for iPhone – Part 4
  • Gravity Tutorial for iPhone – Part 5

That’s it for now. If you’ve got any more resources that aren’t on this list, let me know via the comments and I’ll add them here.

Comments
5 Comments »
Categories
General
Tags
cocoa-touch, iphone, ipod touch, objective-c
Comments rss Comments rss
Trackback Trackback

Upgrading your app to AIR 1.5

Monday, 17 November 2008

In attempting to upgrade the AirShows application to use the new AIR 1.5 runtime, I tried to simply change the target SDK to Flex 3.2 in the project settings. However, this was giving me all sorts of strange errors, from not launching to displaying the following error dialog when trying to launch the application in debug mode:

Flex Builder 3 - Air 1.5 Error Message

On a hunch, I checked the application configuration file AirShows-app.xml file and noticed that it uses the following namespace declaration:

<application xmlns="http://ns.adobe.com/air/application/1.0">

Since the Flex 3.2 SDK actually expects to be building AIR 1.5 applications, I had a feeling that this was the root cause of my problem. A quick change in the namespace to the following solved my problem:

<application xmlns="http://ns.adobe.com/air/application/1.5">

Thankfully I didn’t waste a whole lot of time trying to figure this out, but I do wish Adobe had provided slightly more useful error messages.

Comments
Comments Off
Categories
Adobe AIR
Tags
Adobe AIR, air, Flex 3
Comments rss Comments rss
Trackback Trackback

Motivate yourself by doing it in public

Sunday, 16 November 2008

Productivity and motivation are strange and often elusive things when it comes to your personal projects. You start a project with the best of intentions, have a hyper-productive 2 to 3 day burst right at the start, and then get distracted by some new shiny project. You convince yourself that these projects have been postponed rather than abandoned, but your subconscious knows that they will never see the light of day. Your projects directory becomes a haven for rotting, neglected and increasingly obsolete code that will eventually be lost or deleted.

This is a situation I had accepted as a normal part of being a developer, right up until a week ago when a number colleagues past and present started to upload their personal projects to GitHub. GitHub is an online code hosting service that integrates with Git, a distributed version control system originally written by Linus Torvalds.

Code hosting services have been around for a while, and big hitters like SourceForge and Google Code have done wonders for open source projects. However, GitHub has one important feature that makes it so much more useful than the more established project hosting sites: a social graph. The ability to join a network of friends and automatically see when they’re updating their projects (or adding new ones), to watch or fork those projects for my own ends, gives me the impetus to keep my own projects moving a long.

Right now I only have two projects on GitHub: as3base64 (which was released a few years ago on this site) and AirShows. AirShows is a Adobe AIR-based GUI for editing the configuration file for pytvshows. It’s far from finished, and the code is really quite ugly, but the very fact that it’s now out in the open where my friends can see when I’m working on it (and when I’m not) means that I feel I’m more likely to keep up development.

If Git doesn’t suit your style you don’t have to use GitHub; there are plenty of other code hosting services that offer similar features, such as LaunchPad (Bazaar) and BitBucket (Mercurial). The important thing is that you chose the one that most of your friends are actively using, otherwise you’ll lose out on the very feature that makes these sites so useful for productivity.

A word about licensing

If you’re going to go to the effort of making your projects public, you might as well make them as useful as possible. A lot of developers have heard of the GNU General Public License and often use it for their projects. However, this license requires that the source code for all changes made to your code by third parties must be made available to the public. This means that businesses are often wary of using code licensed under the GPL as part of a project.

All the code I release publicly is licensed under the more liberal MIT License. This license grants developers the freedom to use the code in any way they choose without restriction, so long as the copyright notice remains in the source code. The BSD License is similarly liberal. I urge you to choose one of these two licenses for the code you make available, or at least make sure you understand the implications of the license you end up choosing.

Comments
3 Comments »
Categories
General
Tags
bazaar, bitbucket, git, github, launchpad, mercurial, motivation, productivity
Comments rss Comments rss
Trackback Trackback

The trouble with Flash and REST

Tuesday, 11 November 2008

I find it shocking that the Flash Player still lacks the ability to properly interact with RESTful web services. I keep running into this issue, and every time I scour the Internet hoping that someone, somewhere has found a solution. Every time I return disappointed, hating the Flash Player just a little bit more.

REST stands for REpresentational State Transfer, and describes a technique to organise a web service into resources that can be uniquely identified by a URI. The actions that can be performed on that resource map directly to the standard HTTP methods: GET, POST, PUT, DELETE, HEAD and OPTIONS. With properly organised resources it’s possible to do virtually everything you can do with an RPC-style web service with REST. The benefit of REST is that it goes with the grain of the web, not against it.

The problem with the Flash Player is that the URLRequest class, which is the basis for all HTTP requests, only supports GET and POST operations1. This is due to a limitation in the NPAPI pseudo-standard used by non-IE browsers that only exposes the ability to make GET and POST requests. Unless NPAPI is updated to allow other HTTP methods, and browser vendors and plugin authors update their implementations to match that new API, we need to find other ways of interacting with RESTful web services.

Now, If you’re lucky, the web service you’re trying to interact with will support some way of overriding the request method, such as a X-HTTP-Method-Override header. If this is the case, you can use the requestHeaders property of your URLRequest object to set the appropriate method:

// Create request object with appropriate resource URL
var req:URLRequest = new URLRequest( 'http://rest.example.com/v1/book/1234' );
 
// Use POST because DELETE is non-idempotent
req.method = URLRequestMethod.POST;
 
// Specify DELETE method in X-HTTP-Method-Override header
req.requestHeaders = [ new URLRequestHeader( 'X-HTTP-Method-Override', 'DELETE') ];

If your web service isn’t quite so forgiving, the only option you have is to use the ExternalInferface class and some JavaScript magic to make requests on behalf of your Flash project and send the response back. It’s an ugly hack, but a developer’s gotta do what a developer’s gotta do. If you’re interested in this workaround, leave a comment and I’ll knock up a simple example.

For what it’s worth, Silverlight fares no better in this regard. This is not surprising since Microsoft are stuck with the same browser plug-in APIs as Adobe, but that doesn’t make it any less annoying for developers on both sides of the fence.


  1. If you’re building Adobe AIR applications, you actually have access to the full gamut of HTTP request methods. See the URLRequestMethod documentation for more information. ↩

Comments
8 Comments »
Categories
Flash
Tags
air, Flash, flex, http, JavaScript, representational state transfer, rest, silverlight
Comments rss Comments rss
Trackback Trackback

« Previous Entries

About Dynamic Flash

Steve Webster is a Senior Web Developer for Yahoo! in London, UK.

He is more than a little concerned that he defines himself in terms of his career, and that he talks about himself in the third person.

Find out more

del.icio.us-ed

  • samuel's squawk at master - GitHub
  • Pixelwave - A native 2D iPhone framework, based on the Flash API
  • Pixelwave - A native 2D iPhone framework, based on the Flash API
  • mnot’s Weblog: Are Resource Packages a Good Idea?
  • Download details: IE App Compat VHD
  • ZSync
  • jQuery source viewer
  • Penetration testing tools - Stack Overflow
  • Logrep
  • DOM Window (jquery.DOMWindow.js)

Recent Posts

  • Moving on
  • iPhone / iPod Touch Development Resources
  • Upgrading your app to AIR 1.5
  • Motivate yourself by doing it in public
  • The trouble with Flash and REST
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox