[SWFObject] loading Vars in the source tag.

Geoff Stearns geoff at deconcept.com
Tue Apr 25 19:55:45 PDT 2006


yes, you can do it that way if you like, but i recommend doing it  
using the addVariable.

addVariable uses FlashVars, which means it won't affect the caching  
of your swf, and there is no restriction on the length of vars you  
can pass into the swf (or at least it makes the limit *much* higher  
than the browser limit.

if those vars change at all, every time they change, the browser will  
make a new request to your server, negating speed increase your users  
might get from caching of the swf file.



On Apr 25, 2006, at 7:35 PM, dayvid jones wrote:

> Hi Geoff, thanks so much for creating SWFObject, you've really help
> out a lot of people.
>
> I have a question.  Using SWFObject, can I still load vars in the swf
> string?
>
> So if I have a .swf string like this:
> movie.swf?variable1=value1&variable2=value2&variable3=value3
>
> Do I have to write it like this:
>
> <script type="text/javascript">
>     var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7",
> "#336699");
>     so.addVariable("variable1", "value1");
>     so.addVariable("variable2", "value2");
>     so.addVariable("variable3", "value3");
>     so.write("flashcontent");
> </script>
>
>
>
> Or can I write it like this too:
>
> <script type="text/javascript">
>     var so = new SWFObject("movie.swf?
> variable1=value1&variable2=value2&variable3=value3", "mymovie",
> "200", "100", "7", "#336699");
>     so.write("flashcontent");
> </script>
>
>
> I've tried it the second way and it appears to be working, but I just
> want to make sure.  I'm going to be replacing a lot of embed/object
> tags in the next couple of weeks and I want to make sure I'm doing it
> correctly.
>
> Thanks again.
>
> ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
>
> D A Y V I D     J O N E S
>
> Free Games, Free Music, Cool Photos and Documentaries!
> http://www.dayvid.com
>
> ...shouldn't you be listening to Calico Radio?
> http://www.CalicoRadio.com
>
> music for the mAdNeSs!
> http://www.DJGecko.com
>
>
>
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com




More information about the Swfobject mailing list