Subscribe

  • Subscribe  

Deep Link Flex Application Using SWFAddress

Posted by Charles | February 29, 2008 .

If you are writing a web application, a HTML or Flex one, you’d want it to be found, can be bookmarked, can be shared on social networks. If you are developing a Flex site, you’d like to the state of the site, the “pages” of the site to be treaded by search engine, bookmark site or social networks the same way as the HTML contents. This is a different problem than the one concerned about if the Flash based content can be indexed by Google or not (yes, it can). This concern can be addressed by SWFAddress.

SWFAddress is an open source  library that provides deep linking for Flash and Ajax. It’s a developer tool, allowing creation of unique virtual URLs that can point to a website section or an application state. SWFAddress enables a number of important capabilities which are missing in today’s rich web technologies including:

  • Bookmarking in a browser or social website
  • Sending links via email or instant messenger
  • Finding specific content with the major search engines
  • Utilizing browser history and reload buttons

SWFAddress works with all major browsers, such as Internet Explorer 6+, Mozilla Firefox 1+, Safari 1.3+, Opera 9.02+, Camino 1+, Mozilla 1.8+ and Netscape 8+.

Here is a sample of how it can be used in a Flex application:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" 
   creationComplete="SWFAddress.onChange=getURL">

< ![CDATA[

    private function getURL():void{
        var path:String = SWFAddress.getPath();
        switch (path) {
            case "/Home":
                  content.selectedIndex = 0;
                  break;
            case "/news":
                  content.selectedIndex = 1;
                  break;
            case "/popular":
                 content.selectedIndex = 2;
                 break;
        }
    }
    private function setURL(event:Event):void{
         SWFAddress.setTitle('URL Title: ' + event.target.selectedChild.label);
         SWFAddress.setValue('/' + event.target.selectedChild.label);
    }

]]>

It’s manual and labor intensive way of providing your Flex application with unique internal URLs. In real world, careful planning and coding are needed because you really don’t want this gets in the way of your elegant OO AS3 programming. However, for a business required to feed Google for return, implementing something like this is nothing to do with technology. You just need feel happy that there is something here to help out.

You can check out the live example here.

Leave a Comment

If you would like to make a comment, please fill out the form below.


Name

Email

Website

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Comments

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word


Related Posts

5 Comments so far
  1. Theo  March 1, 2008 1:49 pm

    Hi, if you’re interested I’ve written a piece of code that integrates SWFAddress and Flex 3’s BrowserManager. You can find it here: http://blog.iconara.net/2007/12/28/deep-linking-in-flex-using-swfaddress-and-browsermanager/

  2. handoyo  July 19, 2009 9:00 pm

    Thanks a lot for the tutorial…..

  3. Bludru  January 18, 2010 7:46 am

    Hello there..
    i found another alternative of swf address, http://code.google.com/p/ticlib/ check it out.

  4. palani  September 8, 2010 2:41 am

    worst article

  5. ??????? ?? ???? ? ????????  April 18, 2012 8:43 am

    Deep linking is the very best way to enhance the rankings of niche keywords,
    10x for this article

<

Direct TV Offers - usdirect has the best directtv deals