views:

1014

answers:

1

I am trying to read the value of the FlashVars parameter off of a Flash .swf file that's being embedded onto a page using swfobject. I can't change anything about how the Flash is being put on the page so I'm trying to manipulate it with JQuery. In Firefox the following selector works:

$flashvars1 = $(".homepagecolumn1 embed").attr("flashvars");

In IE6 & IE7 this works:

var flashvars1 = $(".homepagecolumn1 object param [name=FlashVars]").attr("value");

Neither one of the above code snippets works in IE8 though. Instead I get a "variable is undefined" error. Any tips?

Thanks!

A: 

I wonder if IE8 has "fixed" this bug John Resig's Blog post about Object.getElementsByTagName('param') but jQuery might not be ready to handle the "new IE8"?

More thoughts:

If you are using jQuery 1.3, will this work in IE8?

var flashvars1 = $(".homepagecolumn1 param[name='FlashVars']").attr("value");
scunliffe
Thanks for the helpful link. My code works in IE7 though. Why would it not work in IE8?
DMi Partners
do you have a URL we can tinker with? we might be able to catch what is happening on a live site.
scunliffe
http://www.mitchellandness.com/default.aspxI'm trying to rewrite the three Flash image rotators underneath New Releases, Featured Items, and On Sale Now. They're an admin driven Flash file that I'm trying to convert to the JQuery Cycle plug-in onload. I know this may be a bit ambitious but when you first load the page those Flash files take forever to load so I'd rather replace them with JQuery.
DMi Partners
Thanks for the URL... ok so looking at the site... you aren't using jQuery?!?! you are using Mootools! are you aware of this?... e.g. the selector syntax and the way the libraries work is different.
scunliffe
Yeah, I'm not using JQuery yet - I was just showing you the site as it is now. My objective is to convert those three Flash slideshows to the JQuery Cycle plugin. Basically I read the Param with the FlashVars in it and then modify that string to convert it into a div that Cycle can work with.
DMi Partners
I'd be very surprized if the jQuery to "get" the params didn't work in IE8. If you have a "test" server where you can tinker, try the above JS to get the values. If it isn't finding the param elements we can try to re-tweak the selector.
scunliffe
The above did not work unfortunately. Yes, I was using JQuery 1.3.2 but tried 1.3.0 as well. The next line of code is this:$flashvars1 = $flashvars1.replace("image1=", "<img id='image1' border='0' src='");and that's where its saying that $flashvars1 is undefined, presumably because it was never set by the first line.
DMi Partners