SWFAddress is a fantastic little utility that allows you to easily add deep linking and back button support to your Flash websites. From the SWFAddress website:

SWFAddress is a small script that sits on top of SWFObject and provides deep linking for Flash websites and applications. In other words it enables the Back, Forward and Refresh buttons of the browser and creates unique URLs with page titles that can be sent over email or IM.

SWFAddress uses the ExternalInterface functionality introduced in Flash Player 8. It has been tested on the following browsers:

* Internet Explorer 6.0 and 7.0
* Mozilla Firefox 1.5
* Safari 2.04
* Opera 9.02

It’s a great little script, and something I’ve wanted to put together for a long time. Even better: It was designed to work with SWFObject, so if you are already using SWFObject to embed your movies, it’s really really easy to just slap in some deep link and back button support.

Go check it out.

50 thoughts on “SWFAddress

  1. It’s a really nice little utility. It seems that once again things move in parallel on the net as I only last week released something very similar based on the unFocus history keeper. swfaddress is a bit smaller and mine integrates a bit easier on the Flash side.

    Check it out here: http://reefscape.net/?p=10

  2. Nice, Bob. Your stuff also covers a bit about Search engine optimization (if that’s even a correct term here), which is really cool.

  3. Thanks. Making the site usable from a search engine was one of the goals: After all how much use is deep linking & search engine indexing if the visitor always winds up at the home page when following a link from google?

  4. It seems that SWFAddress don’t support SEO capabilities yet, but it’s a step forward in that direction. Hope following versions take care of SEO engines and finaly have what we all are seeking. We are really neare! :).

  5. @ Carlos (and others): What else do you think needs to be added to either my solution or swfAddress?

    I have been thinking of ways to improving or extending it but so far have not come up with any ideas that might help in a framework and are not project specific. The only thing so far is improved browser support but I need some help with.

  6. I have already ditched my own implementation in favor of SWFAddress. It’s nice to have something that plugs into my existing toolchain so easily. My old code didn’t support the back-button, so I’m really happy to be able to get that functionality.

    I don’t care very much for the ActionScript code provided, though. It’s really bad OO and it doesn’t keep the state in a structured way, you need to encode it and decode it yourself (from your abstract format, keys and values for example). I assume that the code is just a simple example of how to work with SWFAddress on the ActionScript side of things.

    Because of this, I have rewritten my previous state handling class to use SWFAddress instead. You are all welcome to have a look at the code and my reasoning around state handling in ActionScript here: http://blog.iconara.net/2006/10/26/swfaddress-back-reload-and-bookmarks-in-flash/#more-35.

  7. @Carlos
    The SEO capabilitites are coming. I have success with UrlRewrite for Tomcat and now I have to port the code to mod_rewrite. The rest depends on the type of website – the static ones may require some manual work while the dynamic ones will need some additional code.

    The SWFAddress API is simple and consistent. You have the same interface in AS1/AS2/AS3. Typically Flash websites are not developed by OO experts. ExternalInterface.available returns ‘true’ in my Flash IDE and this is why I’m using SWFAddress.getId() for browser detection. Support for query parameters will be added in future versions.

  8. One of the known issues was “The Back/Forward popup menu shows the current page title for all the history items.”

    But that seems to work perfectly here in Firefox 2.0 and Internet Explorer 6

  9. damn! you beat me to it. i started to work on something like this a few weeks back, but have been slow to complete it. im utilizing ‘deep-linking’ at my current company, and i thought this would be useful to release. but as i said, you beat me to it, plus, im sure yours is alot better than mine, i will have to take a look, and ‘compare notes’.

    p.s. mine does not include capabilities for forward/back… so already yours is a plus to mine.. and now that i think about it, i probably wont release mine, now that this is out… kinda pointless.

    great work!

  10. The ‘SW’ in SWF stands for shockwave so swf should be pronounced SHWIFF, preferably with an over the top Sean Connery accent.

  11. Not sure if this is the right place to ask this question but, OMG I’m pulling my hair out over IE’s Active Content blocking. I’ve tried everything I can think of. First I did the external .js scripting that Adobe recommended, my content worked in every browser but still had the AC block on IE7. Then I found the Adobe AC Update, I tried that, again, everthing worked in every browser (I’m not testing for anything older than IE6 really, all more current browsers) except IE7. Then I found your little tool (pretty cool!) but in checking it out and running the tests, even that is blocked in IE7! :-O

    I know I can set my IE7 to accept active content, but what do I do for my clients? Help would be appreciated.
    If I go to other sites running AC, they load their Flash fine, so there must be something I’m doing wrong. Are there any good step by step tutorials anywhere for getting around this issue?


  12. Mike u can find what u need if u download swfadress.
    There is a java script file called swfobject that will help u embed flash in html and never have to activate the content in IE.

  13. Man, this is cool… but it’s insanely complicated. It doesn’t work with AS 2.0 either… the include is very complicated and isn’t written in 2.0.

    I am trying to modify the damn thing so it will work in movies that are published in AS 2.0. When I try to compile it right now… it doesn’t work for me.

    Yeah, it’s cool, but again, it needs work.

  14. okay, I am super-excited. I’ve been a flash developer since 2000 and I’ve been working high and low to make it more usable. On my site I have created a flash-based weblog but it lacks dynamic deep linking. Hopefully, this will solve that problem! Geoff, you the man, man.

  15. I’ve been playing around with it some more after some initial problems, and now I’ve realized that this thing ROCKS.

    I’m so surprised there hasn’t been more discussion about it on the forum… this is revolutionary!


  16. Are there any known issues for using this with swfs loading from another domain. I have the script set up on a site that works great with safari, and firefox (mac/pc), but it won’t set hash marks in the url in IE 6 or 7, and it won’t accept a deep link in IE. The javascript and html page are on a main server, while the swfs are loading from an images server. Already had to go live as is. Any ideas?

  17. Adam, Flash Player 9 has some security settings that restrict swfs from other domains communicating with HTML pages they are embedded in if you don’t specifically allow the swf to access the page.

    You can set this with the parameter ‘allowscriptaccess=true’.

    Or if you are using SWFObject, you set it like this:

    so.addParam(“allowscriptaccess”, “true”);

  18. If you are talking about Flash feel free to ask anything. I have just completed Flash and Flash Action Scrpit seminar and there are many new things that have been added to Flash. You can ask mee anything on my blog.. IF you don’t understand swfobject call method you can google or ask. Bye…

  19. We’ve been using SWFAddress just fine, but now have been given a major problem and I sorely hope someone else has devised a fix for it.

    Our site has traffic being driven to it by various paid search engine placements and Flash banner ads. The URLs take advantage of deeplinking by using the hash mark “#” — as SWFAddress has one do.

    All well and good, but apparently users who click on ad placements are first taken to an intermediate site before being redirected to our URL. And apparently, when you try to redirect an IE client to a new URL (using what’s known as a 302 redirect), IE will assume that anything after the hash mark is crap and/or hazardous and will chop it off the URL.

    At least, this is what I’m being told by our metrics vendors, who are explaining why it’s not their problem that none of our deeplinking works with IE clients because hash marks are something that they’ve never had to deal with before in URLs, ever.

    They’re treating it as though it’s some bizarre Flash quirk, which is a bit offensive, since anchor tags aren’t exactly a Flash technology and they’re not exactly new, either.

    Has anyone else run into this?

  20. Hmm, I’ve never heard of behavior like that in IE, have you tested it?

    You might consider creating a little redirect page to send your ad clicks to, like example.com/r/?pageid=

    Then you can redirect from that page to the page with the correct hash.

    But I’d be interested in seeing a test with IE just to know for sure if indeed it is IE’s behavior, or just some server script behavior that isn’t passing the hash along.

  21. Today I finished the integration of swfaddress in our agência design. The page is in portuguese for now, english version is in progress but is already be able to see the swfaddress working at 90%. :)

  22. @Paulo Araujo
    The Flash streaming fails in IE when the address bar contains a # symbol. There’s a Satay-like fix for this in the SWFAddress repository which will be a part of the next release.

  23. When I try to publish it in actionscript 2 I get lines and lines of…

    ActionScript 2.0 class scripts may only define class or interface constructs.

    When I publish in as1 it is no problem in the debugger but doesn’t seem to work.

    Can anyone help me please?

  24. carlosT, you need to use the version 2 .as files (SWFAddress.as and SWFAddressEvent.as) which you can download from the authors site and it comes packaged. Then instead of using #include, use “import SWFAddress” and “import SWFAddressEvent”. This works however I have yet to figure out how to detect when the url has changed. SWFAddress.onChange only seems to trigger once the first time and then doesn’t work which is frustrating.

Comments are closed.