1

I am currently building a flex application and would like to allow deeplinking to produce nice URLS such as http://site.com/#/account/settings and so on.

I have looked at swfaddress 2.4 and swfobject 2.2 to embed the swf and provide the deeplinking. So far everything works in Firefox and Chrome. However, in Internet Explorer 9, the back button and history functionalilty does not work, which is rather frustrating.

Interestingly, the Flex sample file here http://www.asual.com/swfaddress/samples/flex/ works pefectly in IE9. Upon futher inspection, it seems that they are using the ac_OETags.js file to embed their swf. Going through the documentation as well as the index.html file generated by flex, it seems that they are now using the latest version of swfobject as the preferred way to embed swf files.

Having said that, swfobject haven't been updated for more than a year. I am also unsure as to whether the author intends to update it. On the other hand, I do not like the way adobe's history.js works for deeplinking. Urls such as http://site.com/#view=1 looks very ugly in my opinion.

In light of the above, what libraries do you recommend for embedding swf files and deeplinking in a flex 4.5 project?

F21
  • 32,163
  • 26
  • 99
  • 170
  • Honestly anytime I've had to do deep linking, I did it the manual way. I created a kind of navigation delegation pattern and would just use BrowserManager to update the fragment, causing the root view to evaluate the fragment, then delegate any sub-fragment to child views. (ad infinitum for each descendant view that cared about fragments). The problem here, of course, is that typically, at least in my experience, deep linking is an afterthought for product designers, and not built at the time of initial client architecture. – Justin N Aug 24 '11 at 02:39
  • For the record, SWFObject is in the process of being updated to 2.3. Hopefully it will be released in the next few months. – pipwerks Aug 24 '11 at 17:54

2 Answers2

1

Those 2 are the best out there and I recommend you use both. With that said, I would try to debug the javascript/flex to see why this isn't working in IE9 and fix the code on both open source projects so that other developers can benefit from it.

J_A_X
  • 12,857
  • 1
  • 25
  • 31
  • Wasn't sure why, but i deleted the whole project (not much was done anyway) and started from scratch. Swfaddress 2.4 and swfobject 2.2 seemed to play nicely now. – F21 Aug 24 '11 at 02:47
0

The reason this is happening is that Adobe never updated history.js after IE9 came out. There is code in there to handle some IE7 bugs which is being incorrectly triggered.

To fix your history.js insert the following code:

After line 22 insert:

ie9: false,

After line 72 (what was line 71):

else if (browser.version == 9)
{
    browser.ie = false;
    browser.ie9 = true;
}

That should fix it.

JRW
  • 140
  • 4
  • Can you tell me where I must do the second fix ? At mine line 71 I have ...... else if (useragent.indexOf("safari") != -1) { browser.safari = true; browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7)); } – user817057 Sep 05 '13 at 14:31