Deep Linking in Flash with SWFAddress
May 15, 2007
I was working on a small Flash project last night, in which I needed to integrate support for the browser navigation buttons (back and forward). It has been a while since I have needed to do this, so I set about reading about any progress in this area.
To my surprise, things have come a long way and there are now solutions which work on the client-side only (great for small little flash applications which don’t require any server-side integration).
I think the initial idea for the client-side only solution came from Kevin Lynch. I used the SWFAddress solution however, and it worked quite well. It was easy to setup, and provided me the flexibility I needed to have my own control mechanisms within Flash (that responded to the back button being clicked and actually making the change within the SWF).
There was one “gotcha” that had me scratching my head for a while:
- I couldn’t get local testing to work (i.e. loading the container HTML file into the browser from the file:// protocol). Local testing didn’t work until I access the HTML page via my local Apache server.
While SWFAddress goes a long way in taking the pain out of adding browser navigation button support to your Flash project, it doesn’t address implementing the control mechanism within Flash that actually updates the SWF as the user clicks the back button. Implementing a good internal Flash structure such that you can easily change/update SWF content based on back button clicks is the key to painless browser navigation buttons support in your Flash project.
If I have some time in the near future, I might post a couple of good ways to overcome this problem.
technorati tags:flash
