Deep Linking into Flash Applications
this post is ancient (and unfinished), so i’m just going to publish it to get it out of my drafts folder. we need to publish our findings and at that point, i’ll just trackback this to that.
Map the Flash content.
This is best done on paper or in simple diagram form on your computer. You don’t need fancy sitemapping programs, although you can use them if it makes you feel better. When you’re done, you should have a map or outline of your content’s structure.
Decide on a URL scheme
You will pass parameters to Flash telling it which section to load. Each level in your content map usually means another parameter. So a site with two levels of content — call them sections and sub-sections — might have a URL scheme like ?section=foo&sub-section=bar
Name the Content Sections
Every section may not need it’s own name. Think about the natural divisions of your content into sections and screens/pages, and give names to them. Use lowercase letters, avoid punctuation where possible, and use dashes instead of underscores — they’re easier to type and look more natural. These section names plus your URL scheme form your new URLs.
Make a test HTML file with links to the new URLs
This will prove useful later to verify that you mapped your content correctly and consistently.
Code the Flash Content to Respond to Parameters
This is one of those things that’s easy to build into a new Flash movie, but can be harder to retrofit onto older content.
ELABORATE
Thread the parameter(s) through the HTML page into Flash
The web browser does not automatically pass URL parameters through to Flash content in the page — you have to do it yourself. (For that matter, the browser doesn’t even pass the parameters to JavaScript — you have to parse and decode them yourself. Lame.) To make Flash aware of the parameters we’re passing, we’ll create a “smart” object/embed tag which passes URL Parameters through to the Flash
We can do this in the same page as our test links we created above.
Test the end-to-end process:
- from browser link…
- …to html page…
- …to flash content
Optional: Scrub your URLs
if you’re slick and you plan to publish your URLs where query string parameters with ? and & might look ugly, use Ralf S. Engelschall’s mod_rewrite URLs behind mod re-write, i.e. blah.com/foo/bar = blah.com/flash.html?thing1=foo&thing2=bar. Strive to make the /’s in your URLs map to levels of “depth” in your Flash.