Ah, so swfobject v1 you could just grab the vars and pass them in as
the 'flashvars' param.

I wonder if you can do the same sort of hack with v2 - by grabbing the
params (yes, we may want to change it to chop off the '?') and then
passing it in as the 'flashvars' param.

You would just have to change your code to pass the flashvars as a
string instead of an object:

var params = { flashvars: getQueryParamValue() }

Anyone want to test this out?



On Jan 12, 10:54 pm, "Elliot Mebane" <[email protected]> wrote:
> Hi Geoff.  Thanks for the reply in your busy schedule, and thanks for the
> great SWF embedder.
>
> I explored what you suggested -- using the method getQueryParamValue to
> return a single string.
>
> My getQueryAsObj method does all the string manipulation, array splitting
> and the other stuff that breaks the query string into discrete variables for
> use in Flash.
>
> Here's how my method is used:
> var flashvars = swfobject.getQueryAsObj();
>
> Here's a URL of it 
> in-action:http://www.zeroggames.com/lab/flashVars/flashVarsTest.html?queryName1...
> &queryName2=queryValue2&queryName3=queryValue3
>
> My source code is linked in my original post, below. I have looked through
> the docs and api on Google Code but don't see a method that does what I'm
> looking for. Let me know if I've overlooked it.  If it's not already there,
> I think it's helpful and I hope you will incorporate it.
>
> I'll submit this request through official channels at the link Aran
> provided. I'd like to know if you think it will make the cut in a future
> version of SWFObject.
>
> Elliot Mebane
> Adobe Community Expert
> Principal, Zero G Games | ZeroGGames.com
>
>
>
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]] On
> > Behalf Of Aran Rhee
> > Sent: Monday, January 12, 2009 7:34 PM
> > To: [email protected]
> > Subject: RE: New Query String / FlashVars method -- gathers *all* query
> > string pairs with single method
>
> > Geoff.
>
> > I made a test page here:
> >http://www.misterhee.com/tests/params/params.html?foo=bar&abc=123&var3=
> > test
>
> > You can see that if you don't pass a param name, it will also return
> > the "?"
> > from the query string as well which is undesirable.
>
> > I will log a bug.
>
> > Aran
>
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]] On
> > Behalf Of Geoff Stearns
> > Sent: Tuesday, 13 January 2009 1:43 PM
> > To: SWFObject
> > Subject: Re: New Query String / FlashVars method -- gathers *all* query
> > string pairs with single method
>
> > getQueryParamValues already returns the whole query string if you
> > don't supply an argument to it.
>
> > On Jan 12, 6:14 pm, "Elliot Mebane" <[email protected]> wrote:
> > > Hi Aran and SWFObject team. I sent the modification to SWFObject
> > (below) a
> > > while back and didn't see any responses sent to the list.  Is it
> > something
> > > you may be interested in formally supporting?
>
> > > My revision allows you to easily bring *all* query string name/value
> > pairs
> > > from the URL into Flash.
>
> > > Advantages over getQueryParamValue:
> > > -- You don't have to know the query string variable names in advance
> > > -- You don't need a separate line of code for each variable you're
> > > importing. This provides a quick and easy way of bringing in *all*
> > the
> > > variables at once.
> > > -- No errors from spelling mistakes in the param names listed in the
> > > getQueryParamValue method.
> > > -- Updates to your SWF don't require updates to your HTML to
> > accommodate
> > new
> > > or changed variable names.
>
> > > Elliot Mebane
> > > Principal, Zero G Gameshttp://www.zeroggames.com/reel/
> > > [email protected]
> > > 310.237.6629 x104
>
> > > -----Original Message-----
> > > From: ElliotMebane [mailto:[email protected]]
> > > Sent: Wednesday, November 19, 2008 12:58 AM
> > > To: SWFObject
> > > Subject: Revised SWFObject--Populate flashvars with all query string
> > pairs
>
> > > 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?queryN
> > ame1.
> > ..
> > > alue1&queryName2=queryValue2&queryName3=queryValue3
>
> > > Elliot Mebane
> > > Principal, Zero G Games
> > > Adobe Community Expert
> > > [email protected]
>
> > > No virus found in this incoming message.
> > > Checked by AVG.
> > > Version: 7.5.549 / Virus Database: 270.9.6/1797 - Release Date:
> > 11/18/2008
> > > 11:23 AM
>
> > > No virus found in this outgoing message.
> > > Checked by AVG.
> > > Version: 7.5.552 / Virus Database: 270.10.6/1888 - Release Date:
> > 1/12/2009
> > > 7:04 AM
>
> > No virus found in this incoming message.
> > Checked by AVG.
> > Version: 7.5.552 / Virus Database: 270.10.6/1888 - Release Date:
> > 1/12/2009 7:04 AM
>
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.552 / Virus Database: 270.10.6/1888 - Release Date: 1/12/2009
> 7:04 AM
--~--~---------~--~----~------------~-------~--~----~
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