I'm not sure I understand. If you are using BrowserManager, it pulls the
information from the html page's URL, not the one in the embedSWF.
(I don't know if it's better to use BrowserManager or SWFAddress for deep linking)
I want to create like a "landing page", an html page that loads my application in a given state, different from the generated html wrapper that loads the application in the starting state. I need to know what I have to do so that the html wrapper loads the swf application in a given state.
Then do your in-flex code for handling deep linking, event listeners etc which I wont go into because it cant be told, it has to be learnt.
Now, I have just re-read your post and realised that you just want a landing page. Just Clone your application. Have one swf start at the state you want and the other start at the state you want. Your choice but if you dont have to overcomplicate things, dont..
Indeed my problem is not how to use deeplinking in my flex application, but how to have html page that loads my flex application in a given state.
I don't want to clone the flex application, it seems a bad solution to me to have as many swf as states in the application.
A solution to this is to have one html page per state (with alternative content that can be read by search engines) and each html page loads the application in a specific state. So I want to create as many html pages as sections in my flex application so that SE index all sections of my application.
Like www.cartier.com does for example.
(I just start to get into SEO, tell me if I'm wrong)
I just thought I could set flashVars in each html wrapper according to the state I want to display, and in the starting application use the flashVar to know the state to go. Is it a good idea ?
If you just want to have loads of html file that load your app in a certain state then you will need to use flashvars. Have a flashvar on each page called state.
<param name="flashvars" value="state=state1" />
<param name="flashvars" value="state=state2" />
<param name="flashvars" value="state=state3" />
Or use a bit of VB in the JS of an ASPX page
<param name="flashvars" value="state=<%=Request.QueryString("state")%>" />
and get it from the querystring
then in your app get the flashvar
var params:Object = FlexGlobals.topLevelApplication.parameters;
var state:String= params.state
Then have state changing logic based on the state value.
Message was edited by: Mattr1981
Yes, Jamoptical works exactly as I want.
(Is it common ? Or is there a more simple/efficient way to have flash website optimized for search engines ?)
So I will use flashvars then. Thank you!
There are a few ways to get your flex site into the search engines. Jam Optical has only been online for 9 days and I am already ranked 10 for "quality prescription glasses". I chose this keyword as a test to see if it is possible to get onto a good rank through natural search results. I'm currently goiing after some more keywords, but enough about that.
I use a combination on urlrewrite on iis 7, a query paramater, swfobject, swfaddress, flashvars, and alternative content on the asp page.
The sitemap I submit to google contains the links in the form http://www.jamoptical.co.uk/store/frames/10043
this is essentially the url http://www.jamoptical.co.uk/store/page.aspx?param=10043 but google doesnt like http://www.jamoptical.co.uk/store/#/frames/10043, it sees it as http://www.jamoptical.co.uk/store/
Using swfaddress and flashvars i first check the validity of the param (This is a MUST) when my application loads, that it exists and is valid. If both are true i set a desired state in my application in the code. While the Google robot CAN read small bits of info from my SWF, I also present alternate content that is EXACTLY shown as on my SWF. Otherwise it could be considered cloaking. The next trick is to then make sure that when the user leaves the page to go to the stores main page or to proceed with buying the item that swfaddress rewrites the url to a more swfaddress friendly format http://www.jamoptical.co.uk/store/#/catalogue for the main page or http://www.jamoptical.co.uk/store/#/purpose for the next page. The application data is in an arraycollection which is packaged/serialised up and stored in session so that when they move to the next page no data is lost (i.e. if they have something in the cart).
This is so that once they have moved on, they can enjoy the benefits of swfaddress integration and browser back button use.
It seems to work.
I was going to write large article on this post it to my blog but I dont quite have the time at the moment. I truly believe RIA's can be SEO Friendly and now I have a bit more free time on my hands would like to give back to Flex and RIA developers.
PS if anyone else reads this I would love comments and suggestions about the site (Negative and Positive all welcome), find me on FB,
Message was edited by: Mattr1981
Thank you for sharing that.
There is something I didn't understand when I read about SEO and flash, and you mention it too :
Google would be able to read text in SWF... so why do we have to use alternative content ?
Because depite the headless flash players abilty to get stuff from an swf, its not great. It might not read it all, or it might give up a few KB into the SWF. If it sees the ALT content, it will read that. Just make sure your alt is the SAME as your swf stuff. You dont want to be considered to be cloaking.