I've made the following update to swfobject.js. It is similar to
getQueryParamValue except that rather than specifying the query
variable to retrieve, this function returns an Object populated with
all the name/value pairs from the query string.

The advantage of this is that you don't have to specify what name/
value pairs to expect.

I've tested this in all my Windows XP browsers and it works.

Will the SWFObject team review the code, revise as necessary for cross-
browser and cross-platform compatibility, and consider including this
new function in the next release of SWFObject?  I think it would be
helpful for the community.

To avoid collisions with other variables, I created new variables
starting with ba, bb, bc... I'm sure that the SWFObject owners can
advise about the best variable names to use instead.

New SWFObject function:
getQueryAsObj:function(){var ba=K.location.search||K.location.hash;var
bd={};if(ba){var bb=ba.substr(1).split('&');for(var
bc=0;bc<bb.length;bc++){bd[g(bb[bc].substring(0,bb[bc].indexOf('=')))]
=g(bb[bc].substr(bb[bc].indexOf('=')+1))}}return bd}

To use the new function, rather than assigning an empty Object to the
flashvars variable in the script section of the HTML page, assign the
results of the getQueryAsObj function to the flashvars variable.
Additional name/value pairs can still be added to the flashvars
Object.

EX: var flashvars = swfobject.getQueryAsObj();

Here is a functional example and downloadable source files:
http://www.zeroggames.com/lab/flashVars/flashVarsTest.html?queryName1=queryValue1&queryName2=queryValue2&queryName3=queryValue3

Elliot Mebane
Principal, Zero G Games
Adobe Community Expert
[EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to