Ok, so first of all, you need to get rid of the object/embed definition of
the same flash file in the flashcontent div. This is supposed to be used for
alternative content for people who don't have Flash.
It is easy to test if the variable is being read correctly. Just test with
an alert statement:
<script type="text/javascript">
var so = new SWFObject("ProductSlide.swf", "ProductSlide", "726", "331",
"8", "#f9f5e0");
alert("selected: " + getQueryParamValue ("hpBagSelected"));
so.addVariable("hpBagSelected", getQueryParamValue ("hpBagSelected"));
so.write("flashcontent");
</script>
If the alert shows the expected value of "Pizza", then you know you are
grabbing it correctly and should be available in your swf.
Aran
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of PixelPhysician
Sent: Friday, 6 March 2009 2:46 PM
To: SWFObject
Subject: Can't read a url variable from flash
I am having difficulties transferring a variable from a flash file on
one page to a flash file on another page...I am passing the variable
through the url.
http://www.example.com/ProductSlide.html?hpBagSelected=Pizza
The issue is present in both Firefox and IE. Here's what I have on the
html page, and the swfobject.js file is in the same directory. I would
appreciate any input - I am new to swfobject and any input would be
greatly appreciated.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Products</title>
<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent" align="center">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=9,0,0,0" width="726" height="331"
id="ProductSlide" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="ProductSlide.swf" /><param name="quality"
value="high" /><param name="bgcolor" value="#f9f5e0" /> <embed
src="ProductSlide.swf" quality="high" bgcolor="#f9f5e0" width="726"
height="331" name="ProductSlide" align="middle"
allowScriptAccess="sameDomain" allowFullScreen="false"
type="application/x-shockwave-flash" pluginspage="http://
www.macromedia.com/go/getflashplayer" />
</object>
</div>
<script type="text/javascript">
var so = new SWFObject("ProductSlide.swf", "ProductSlide", "726",
"331", "8", "#f9f5e0");
so.addVariable("hpBagSelected", getQueryParamValue
("hpBagSelected"));
so.write("flashcontent");
</script>
</head>
<body bgcolor="#f9f5e0">
</body>
</html>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---