Hmmm. I had a look through the expressInstall swf code as well as the code to write the expressinstall swf to the page. You are quite correct that MMredirectURL is already filled as part of the Flashvars sent to the expressInstall SWF:
fv = "MMredirectURL=" + win.location.toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; So, there are two options I see: 1) modify swfobject.js to either a) (the nicer way, but requiring a bit more code) check for the MMredirectURL variable. If it is not passed, then set the default as above. Or b) (easy) just remove "MMredirectURL=" + win.location.toString().replace(/&/g,"%26") +" out of the line (which means you HAVE to pass your own value or it will fail to redirect anywhere after completion. 2) modify expressinstall.swf /.as to expect another var (e.g. CustomredirectURL), and check for its existence. Redirect to this value on complete. If the var is not passed, then fallback to MMredirectURL. (modify the below line in expressinstall.as) loaderClip.redirectURL = _level0.MMredirectURL; The source to all files are included in the download .zip To me, option 2 is better as it means you can continue to use future swfobject.js files which get released without having to re-patch etc. Cheers, Aran On Tue, Jul 27, 2010 at 11:57 AM, jmmygoggle <[email protected]> wrote: > Number 1 is not really an option if you are using swfobject to embed a > flash app on Facebook, so I attempted the 2nd option. > Any flashvars I added to try and set a new redirect URL were > overridden by the defaults that were appended during the > showExpressInstall call. > > E.g. using this code to create params for showExpressInstall: > var att = { data:"expressInstall.swf", width:"300", height:"120" }; > var par = { flashvars:"MMredirectURL=http://apps.facebook.com/myapp/", > menu:false }; > > Results in: > <param name="flashvars" value="MMredirectURL=http://apps.facebook.com/ > myapp/&MMredirectURL=http://myserver.com/facebook/myapp/ > > test_api_express_install.html&MMplayerType=PlugIn&MMdoctitle=SWFObject > 2.2 API showExpressInstall example (t - Flash Player Installation"> > > The default myserver.com location of the iframe was not overridden by > my desired facebook.com parent location. > > I also tried using the callbackFn on swfobject.showExpressInstall() > but it is only useful on cancel, as a success bypasses the open > window, launches a new one (required to complete the upgrade) and > redirects to the default swfobject MMredirectURL that was pulled from > the original iframe location. > > Is there any other way to set a custom MMredirectURL for > expressInstall.swf similar to the old xiredirecturl? > Maybe I'm missing something important in the docs/api? > > > > > > 2) you can use the lower level APIs for SWFObject 2.x ( seehttp:// > code.google.com/p/swfobject/wiki/api). Specifically createSWF() and > > showExpressInstall(). > > > > e.g. > > > > <script type="text/javascript" src="swfobject.js"></script> <script > > type="text/javascript"> function cancelFunction() { alert("do somethig > now > > that expressInstall has run"); } if > (swfobject.hasFlashPlayerVersion("10")) > > { var fn = function() { var att = { data:"flashContent.swf", width:"300", > > height:"120" }; var par = {}; var id = "myContent"; > swfobject.createSWF(att, > > par, id); }; } else { var fn = function() { var att = { > > data:"expressInstall.swf", width:"600", height:"240" }; var par = {}; var > id > > = "myContent"; swfobject.showExpressInstall(att, par, id, > cancelFunction); } > > > > } swfobject.addDomLoadEvent(fn); </script> > > > > -- > You received this message because you are subscribed to the Google Groups > "SWFObject" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<swfobject%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/swfobject?hl=en. > > -- You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.
