[SWFObject] Initializing variable

Javier javier at middia.jazztel.es
Tue May 2 20:23:48 PDT 2006


Thanks a lot for your prompt answer.

  _____  

De: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] En nombre de Geoff Stearns
Enviado el: miércoles, 03 de mayo de 2006 5:02
Para: swfobject at lists.deconcept.com
Asunto: Re: [SWFObject] Initializing variable


well you are on the right track... 

the one difference you'll have with getQueryParamValue() is that it returns
an empty string if the value isn't found, so instead of checking for null,
you'll want to check for an empty string.

you could modify your code in the flash movies like so:

if (vol == null || vol == "") vol = 100;


On May 2, 2006, at 9:46 PM, Javier de Alfonso wrote:


Hello, I need to set a variable called "vol" (volume) to 100 when first
entering our homepage, and then allowing the visitor to change it with a
slider, so I need to pass its value from page to page. (The web is made from
several html pages with one flash in each).

Before the EOLAS issue I used the following html code in every page to get
variables from the url:


<SCRIPT LANGUAGE="JavaScript">
<!--
document.write(
'<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\n'+
' codebase="
<http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version
=6,0,29,0>
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=
6,0,29,0" width="975" height="580" ID="inquiero">\n'+
' <param name=movie VALUE="index.swf'+document.location.search+'">\n'+
' <param name=quality VALUE=best>\n'+
' <param name=wmode VALUE=transparent>\n'+
' <embed src="index.swf'+document.location.search+'"\n'+
' quality=best wmode=transparent width="975" height="580"
align="absmiddle"\n'+
' type="application/x-shockwave-flash"\n'+
' pluginspage="\n'"
<http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Shoc
kwaveFlash>
>http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Shoc
kwaveFlash"></embed>\n'+ 
'</OBJECT>');
//-->
</SCRIPT>

and the following AS inside the flash:

if (vol==null) {vol=100};

So when first entering any page the value of "vol" was set to 100 if it
wasn't passed from the url.

How should I use Geoff's SWFObject to achieve the same?


I tried on every html:
so.addVariable("vol", getQueryParamValue ("vol"));
and inside every flash:
if (vol==null) {vol=100};

But "vol" always sets to 0.

Could you give a hand here? Thank you in advance.

Javier.
Madrid. Spain.
_______________________________________________
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/20060503/4b913b49/attachment-0005.htm>


More information about the Swfobject mailing list