So we are on another project that needs deep linking, and trying to decide on the format of the urls. We use SWFAddress and create a proxy for it in pureMVC which is fairly easy. The format of the URL and query string parameters is what we seem to spend a lot of time dwelling on.
One of our other projects uses a simple token relationship since it is flex module based where the name of the module and the parameters it needs are sent in the url
e.g
http://www.somesite.com/content.html#/thepageName/moduleName/moduleArgument
so if we had a link to the home page, needed to tell the video module the video to play and the news module to show headlines it would be :
http://www.somesitecom/content.html#/home/videoModule/http://somestreamingsite.com/videoid=12345/NewsModule/show=headline
its works but its not like traditional query string style urls like we are used to in basic server based apps.
Our new projects needs to be able to provide the current page, the currently 'focused' item and arguments to other items so we are considering
http://www.somesite.com/content.html#/home&focus=video&videoId=124&someotherThing=456&anotherone=789
its a bit more typical query string style. I'm not married to any particular style but would at least like to decide on one and then be consistent across projects, I'd love to see how others have handled more complex deep linking with swf Address. The requirements for us are
- provide a "page" in the deep link
- provide arguments to specific modules or components for that page
- allow components on the stage to get multiple arguments and not just one, e.g. the url to the video, should it auto play, should it go full screen ?
- provide a focus for the page, i.e. the video module has focus if the page is complex and you should be able to state the item with focus on the page
I welcome discussion on this topic
Hey Grant,
For one of my recent previous projects, we added a few methods to SWFAddress to accomplish just this. In a nutshell, we would set a value like you would normally in SWFAddress, but with a new method would allow for the ability to pass in an object of value paris which would be appended to that SWFAddress value as query string parameters.
For example: http://www.somesite.com/somePage.html#/brand/?item=43&id=3/hopup/?item=2&showme=1
SWFAddress.clearParamObj();
SWFAddress.addToParamObj( "brand", { id : 3, type : video } );
SWFAddress.addToParamObj( "hopup", { id : 1, showme : true } );
SWFAddress.applyParamObj();
To get param values:
var values : Object = SWFAddress.getValueAsParamObj();
if( values.brand ) trace( values.brand.id );
if( values.hopup ) trace( values.hopup.showme );
It's in it's early stages but does the job. Here's the updated SWFAddress file we used:
http://www.krisrange.com/samples/SWFAddress/SWFAddress.as
Kris
Posted by: Kris | February 02, 2009 at 01:31 PM
Thanks, thats a really nice idea, I'm going to check it out as it does simplify a lot of junk
Posted by: Grant Davies | February 03, 2009 at 09:43 AM
I'm having problems with deep linking with SwfAddress, to link between interior areas. I firefox works well, but in Explorer it's refreshing the all website and then enters the section.
In Firefox it's smooth, just open inside the area.
Sorry about english
Can anyone help?
Posted by: Gualter Amaror | April 23, 2009 at 11:45 PM
Do you have an example posted on the internet somewhere, we just did a site using swfaddres = http://www.itsasoftdrink.com and it works great in IE, firefox and safari
Posted by: Grant Davies | April 24, 2009 at 09:04 AM