[SWFObject] Getting connection errors with my flash chat program

Aran Rhee aran.rhee at qdc.net.au
Fri Nov 24 22:00:50 PST 2006


John.

A few things.

1. The below are all parameters, not variables

so.addVariable("allowScriptAccess", "always");
so.addVariable("movie", "<?=$ray_dir?>ray_chat_loader.swf");
so.addVariable("quality", "high");
so.addVariable("wmode", "transparent");
so.addVariable("base",
> "http://<?=$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME
'])?>/");

The should be added like the below:

so.addParameter("allowScriptAccess", "always");

*** BTW you don't need movie param, as this is already created for you in
your swf constructor call. ***


2. FlashVars is one variable with "&" delimited values in normal embedd, but
in swfObject you pass name value pairs seperately (it constructs the
flashVars for you from the pairs). So the vars you want to add would be
something like:

so.addVariable("ID", <?=$ID?>);
so.addVariable("NickName", <?=$NickName?>);
so.addVariable("url", <?=$ray_xml?>);
so.addVariable("lang_url", <?=$ray_lang?>);


Cheers,
Aran

> -----Original Message-----
> From: swfobject-bounces at lists.deconcept.com 
> [mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of 
> Lifestyle Clubhouse administrator
> Sent: Saturday, 25 November 2006 2:21 PM
> To: swfobject at lists.deconcept.com
> Subject: [SWFObject] Getting connection errors with my flash 
> chat program
> 
> I can't get SWFObject to work with my flash-based chat 
> program. Here's the original working code:
> 
> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
> codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/
> flash/swflash.cab#version=8,0,0,0" 
> width="730" height="515" id="ray_chat" align="middle"> <param 
> name="allowScriptAccess" value="always" /> <param 
> name="movie" value="<?=$ray_dir?>ray_chat_loader.swf" /> 
> <param name="quality" value="high" /> <param name="wmode" 
> value="transparent" /> <param name="base" 
> value="http://<?=$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIP
T_NAME'])?>/" 
> />
> <param name="FlashVars" 
> value="ID=<?=$ID?>&NickName=<?=$NickName?>&url=<?=$ray_xml?>&l
ang_url=<?=$ray_lang?>" 
> />
> <embed
>         src="<?=$ray_dir?>ray_chat_loader.swf"
>         id="ray_chat"
>         quality="high"
>         wmode="transparent"
>         bgcolor="#ffffff"
>         width="730" height="515"
>         name="ray_chat"
>         align="middle"
>         allowScriptAccess="always"
>         
> base="http://<?=$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT
_NAME'])?>/"
>         
> FlashVars="ID=<?=$ID?>&NickName=<?=$NickName?>&url=<?=$ray_xml
?>&lang_url=<?=$ray_lang?>"
>         
> pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>
> 
> 
> And here's the new code with SWFObject:
> 
>         <script type="text/javascript">
>           var so = new SWFObject("<?=$ray_dir?>ray_chat_loader.swf",
> "ray_chat", "730", "515", "8", "#ffffff");
>           so.addVariable("allowScriptAccess", "always");
>           so.addVariable("movie", "<?=$ray_dir?>ray_chat_loader.swf");
>           so.addVariable("quality", "high");
>           so.addVariable("wmode", "transparent");
>           so.addVariable("base",
> "http://<?=$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME
'])?>/");
>          so.addVariable("FlashVars",
> "ID=<?=$ID?>&NickName=<?=$NickName?>&url=<?=$ray_xml?>&lang_ur
l=<?=$ray_lang?>"); 
> 
>           so.write("flashcontent");
>         </script>
> 
> The script loads up, but I get a connection error with my 
> chat server. 
> I've experimented with adding "getQueryParamValue" to the 
> "base" and "FlashVars" variables, but that didn't work.
> 
> Any ideas? Thanks in advance.
> 
> John
> 
> 
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com




More information about the Swfobject mailing list