Asual

Friday,
18 May 2007

SWFAddress bad practices

As the number of SWFAddress powered sites grows I often see problems caused by poor implementations or lack of information. Here is a list of the top 5 practices which should be avoided:

Usage of getURL() for user tracking, statistics and popups
While this is a standard Flash functionality used for years, the combination with ExternalInterface introduces a critical bug with Internet Explorer. The resolution is to use ExternalInterface for every JavaScript call. SWFAddress 2.0 will help you with some predefined methods for popups and blank window links.
Homepage address values like '#Home' or '#/root'
Such address values are not needed and should be replaced by SWFAddress.setValue('/'). The usage of http://domain.com/#home creates an unneeded history entry when http://domain.com is opened.
Address values naming using camelCase or other forms of custom convention
SWFAddress samples clearly define the best naming convention for deep links. Web addresses are case insensitive and the standard is lower case. For readability and Google SEO compatibility reasons the convention 'my-deep-link' is more appropriate than 'myDeepLink' or 'My_deep_link'. The format http://domain.com/#/my-deep-link/?param=value is the only one fully compatible with the SWFAddress SEO rewriting.
Including SWFAddress before the TITLE tag
SWFAddress contains a fix for Internet Explorer and URLs which contain anchors. In order to benefit from it the title tag should be printed before the swfaddress.js include.
Duplication of navigation logic
Integration of SWFAddress into a legacy code may require the following implementation: For brand new projects, the best way to organize your code looks like this:

Update: The post has been updated for SWFAddress 2.0.

« Previous Post | Next Post »

Comments:

Left by Psilos at Wed, 5 Sep 1:45 PM

How can I find out if eventIsCalledFromTheBrowser?
So that it executes only then?

Thanks in advance.

Left by molamil at Mon, 10 Dec 5:12 PM

Yup, I have the same issue - I'd need to somehow differentiate the setValue() calls from Flash and from the Browser.

As far as I can see, setValue() only supports 1 method. And it's called equally from Flash and from the JavaScript.

Cheers.

Left by insanegman at Wed, 27 Feb 5:55 AM

I too would like to know how to differentiate the source of the setValue event dispatch. Some boolean like "eventFromBrowser" would be adequate.

Left by Ryan at Tue, 15 Apr 12:21 AM

Althought I appreciate the whole SEO thing, using "-" within Actionscript is just a bit of a pain since it's an operator. Any suggestions for this issue?

Left by Rostislav at Tue, 15 Apr 12:57 AM

@Ryan
The hyphen is good for indexing because Google treats it like a space. Since it's a string so far I haven't seen any problems with it. If you want to map deep links to instance names then probably you can replace it with an underscore?

Your comment:

Security Code

Live Comment Preview:

 

Projects

Syndication

Blog Search

Blog Categories

Blog posts

Recommended sites