[SWFObject] passing variables

Aran Rhee aran.rhee at qdc.net.au
Tue May 23 18:04:58 PDT 2006


Sibrand.
 
Did you pass in all the vars required? In your query string example you also
have an active and allowDomainUrl variable. SwfObject is creating the
flashvars just like the normal object/embed tag method would be, so if
adding your variables as a flashVars string works normally, it should also
work using swfObject.
 
If you look in the actual swfObject  code, all it is doing is something like
this:
 
// splits all the vars you added through addVariable() from an array back
into a string concatted with an ampersand
theVars = this.getVariablePairs().join("&");
// adds the string to flashvars during object creation
"flashvars=\""+theVars+"\"";
 
Anyway, if you are happy with appending a query string, then that's cool. 
 
BTW - On player 6.0r47 you cannot use a query string to load data if the
file is being viewed locally (browser on local machine / cdrom etc)  (could
be others too, so just be careful with your local testing before putting on
the web). Just to be safe, I'd put the same string into flashVars as well.
 
Aran


  _____  

From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Sibrand Hoekstra
Sent: Tuesday, 23 May 2006 5:47 PM
To: swfobject at lists.deconcept.com
Subject: Re: [SWFObject] passing variables


this is weird, because in the original version, they also include an xml
like this: 

 thing.swf?urlXML=/data/xml/nav.xml&kleur01=ff00000 
when i wanted to load the xml through addVariable("urlXML",
"/data/xml/nav.xml");
my menu[built by xml]  wouldn't show up.
i am now using the huge strings like this:

<script type="text/javascript">

   var so = new
SWFObject("/stones/nav/nav.swf?urlXML=data/xml/nav.xml&active=1&allowDomainU
RL=http://www.buyways.nl
<http://www.buyways.nl&kleur01=FF0000&kleur02=960000&kleur03=FF6000&kleur04=
808080> &kleur01=FF0000&kleur02=960000&kleur03=FF6000&kleur04=808080" ,
"nav", "450", "100", "6", "#ffffff");

   so.write("navigation_main");

</script>
and it works as well.

(this is ok for me; now i won't have to go through every object tag to cut n
paste each variable passed throughout the whole app :')  )

Thanks anyway for you responses!

Sibrand


Aran Rhee wrote: 

Sibrand



When you  addVariable("kleur01", "FF0000"), it is equivalent to adding

kleur01 through flashVars. Do one addVariable call for each var you want to

add and all should be well..





Cheers,

Aran



  

-----Original Message-----

From: swfobject-bounces at lists.deconcept.com 

[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of 

Sibrand Hoekstra | Buyways B.V.

Sent: Monday, 22 May 2006 7:17 PM

To: swfobject at lists.deconcept.com

Subject: [SWFObject] passing variables



Hello List,



I am working on an application where the flashcontent is 

delivered by an external party.



the swf needs to get some colors and other data, and this is 

passed [a little ugly imho] as follows:



<embed 

src="/stones/nav/nav.swf?urlXML=data/xml/nav.xml&active=1&kleu

    

r01=FF0000&kleur02=960000&kleur03=FF6000&kleur04=808080" [...] > />

  

My question, how do i pass these variables using the almighty 

swfObject.



i'm afraid  addVariable("kleur01", "FF0000");  won't work as 

they aren't FlashVars, right?



Thanks in advance,



Sibrand



-- 

Sibrand Hoekstra       BuyWays BV            T +31 50 3118123

sibrand at buyways.nl     Friesestraatweg 217c  F +31 50 3118124

http://www.buyways.nl  9743 AD  Groningen    M +31 6 41910167



_______________________________________________

SWFObject mailing list

SWFObject at lists.deconcept.com

http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com

    

_______________________________________________

SWFObject mailing list

SWFObject at lists.deconcept.com

http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com

  


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20060524/2f796ead/attachment-0005.htm>


More information about the Swfobject mailing list