[UPDATE] I've updated template to SWFObject 2.1
And there is a bit smarter way to register flexApplication with BrowserHistory:
var flashvars = {
name1: "hello",
name2: "world",
name3: "foobar"
};
var params = {
menu: "false"
};
var attributes = {
id: "${application}",
name: "${application}"
};
swfobject.embedSWF ( "${swf}.swf", "${application}_div", "${width}", "${height}", "${version_major}", "expressInstall.swf", flashvars, params, attributes );
swfobject.addLoadEvent(loadEventHandler);
function loadEventHandler() {
BrowserHistory.flexApplication = swfobject.getObjectById("${application}");
}
name1: "hello",
name2: "world",
name3: "foobar"
};
var params = {
menu: "false"
};
var attributes = {
id: "${application}",
name: "${application}"
};
swfobject.embedSWF ( "${swf}.swf", "${application}_div", "${width}", "${height}", "${version_major}", "expressInstall.swf", flashvars, params, attributes );
swfobject.addLoadEvent(loadEventHandler);
function loadEventHandler() {
BrowserHistory.flexApplication = swfobject.getObjectById("${application}");
}
I have been using Geoff Stearns' SWFObject for a long time. I think it will be useful to share my index.template.html that tuned for using with SWFObject
Project Archive [updated - 07-07-2008] ( broken link has been fixed)
Have fun with it!
Cheers!
12 comments:
Great work!
thanks Ted.
It would be nice to have in next Flex Builder the possibility to choose what html template you want to use with particular project.
May I plug my BrowserManager-SWFAddress integration kit? It allows you to use SWFAddress instead of Adobe's history code, which gives you Google Analytics-integration more or less for free.
http://developer.iconara.net/objectlib/flex-browsermanager-swfaddress.html
For sure Theo. I think it's good idea.
Thanks a million...
it works like a charm
The SWFObject project team has recently also worked on this issue, by updating history.js and FABridge.js in such way that they work with both Flex publishing templates and SWFObject publishing:
http://code.google.com/p/swfobject/wiki/flex
Very nice. I actually have had this same work around running on my site D-Flex.org. Check it out (good developers view source)
After days of struggling the FB3 and urlkit and the other derivatives out there. I stumbled on your site and tried the SWFAddress integration kit.
Wow. This is what I was looking for!!!
Within 30 minutes, I had it working. within 1 hour, I had 75% of the deep linking working.
What a lifesaver!
hi Oleg, the link is dead, could you repost please? thx
Jan, broken link has been fixed. Thanks.
Hi, I am going to migrate form default template file to template based on SWFObject. I have one question about your index.template.html. I see that you set body style twice, in script block
swfobject.createCSS("body", "margin:0; padding:0; overflow:hidden; height:100%;");
and in style block:
body { margin: 0px; overflow:hidden }
Is it necessary?
Hi Denis, no that's not necessary to set it twice - it was left as I was testing different style settings.
Post a Comment