Archive | June, 2009

Tracking Flash / Flex / AIR applications with Google Analytics

In case you weren’t aware, a lot of the stuff you can do in a website you can also do in the Flash Player.  Prime example: Google Analytics tracking.

Now for a simple Flash movie, you’d traditionally host the Flash file in an external website, and add the tracking to the HTML pages.  If you’re doing something a little more different – or are obsessive about knowing how your users are interacting with the content – you might be interested to know that there is support for actionscript-initiated tracking, and that it’s supported by Google themselves (a good sign).

You can read all about the Google Analytics tracking component for Flash on the Google code website: http://code.google.com/apis/analytics/docs/tracking/flashTrackingIntro.html

Where this really comes into its own is in AIR applications.  Flash / Flex tracking in a HTML website isn’t really all that special – once you know the API a little, you can always use the ExternalInterface commands in the Flash Player to communicate with javascript functions on the host page, but that kind of option isn’t usually available to a pure Flash-based AIR application.  Using the component effectively removes the need for the external javascript file, and means that your desktop AIR application can communicate freely with Google Analytics – enabling application tracking.  The code is no different whether its an online Flash webpage, or a desktop AIR application.

Link: Flex – Creating Custom Components

http://www.defusion.org.uk/archives/2007/11/25/quick-link-flex-creating-custom-components/

Link: POSTing XML data, without using HTTPService

[This came up a while ago, but I thought I'd promote the link I found that solved my woes.]

The situation: I’m trying to interact with a REST API, via Flex and AIR.  Now, I know that the HTTPService class exists in Flex to make it really quick and easy to send and recieve data, but the downside of the HTTPService class is that it assumes a little top much.  It assumes for example, that any data you’re trying to send comes in a name/value pair – which my data doesn’t. The REST webservice I’m using requires raw XML data, but the HTTPService class doesn’t do that.

The solution?  Well, there’s only one – don’t use the HTTPService class, and code everything yourself.  Thankfully, this link I found tells you exactly how to do that, along with examples.

http://tacfug.org/blog/index.cfm/2007/3/26/Flex–Posting-XML-without-using-mxhttpservice-

What are you looking at? (Introducing Screentweetr)

Screentweetr is my latest little side project; an AIR application for uploading desktop screenshots to twitter image services. You can download it now, from the AIR Marketplace.

Screentweetr

So, what is Screentweetr?

Screentweetr is an application built on AIR (Adobe Integrated Runtime). It uses the TwitPic service – which links in to your twitter account – and takes image data from your clipboard and allows you to quickly upload it directly to TwitPic, and the option to immediately tweet the same image on Twitter. Read More…

Tweener – 4 years old now(!)

Zeh Fernando has posted about Tweener – a bit of a roundup of the development and demise [of Tweeners' development] of Tweener.  In short, it’s no longer being developed, but it still works and is still pretty awesome.  That doesn’t do the post justice though, so head over and read the full post at Zeh’s blog;

http://zehfernando.com/2009/tweener-4-years-later-a-post-mortem/