[SWFObject] Dynamic XML via SWF using SWFObject

Paul Lugo plugo at netshops.com
Fri Dec 8 15:48:21 PST 2006


The existing code works as intended. Once I use SWFObject, the .swf is
there, but is not visible, so I'm not sure if I'm coding incorrectly,
missing something, or have just reached the point of insanity. The swf
and xml reside in the same directory, the images are pulled from a
separate image server. Any suggestions are appreciated.

Existing code:

<div id="zoom">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swfl
ash.cab#version=7,0,0,0" width="400" height="400" id="master360"
align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie"
value="http://is.netshops.com/images/products/360_spin/master360.swf?sku
XML=http://is.netshops.com/images/products/360_spin/WES220001" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed
src="http://is.netshops.com/images/products/360_spin/master360.swf?skuXM
L=http://is.netshops.com/images/products/360_spin/WES220001"
quality="high" bgcolor="#ffffff" width="400" height="400"
name="master360" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</div>

Converted code with and without this bit of actionscript on the first
empty frame:
#include "expressinstall.as"
var ExpressInstall = new ExpressInstall();
if (ExpressInstall.needsUpdate) {
 ExpressInstall.init();
 stop();
}

The other bit of actionscript in the FLA on frame 2 with the compiled
clip is:
vr_mc.loadVR( skuXML + ".xml" );

<head>
<script type="text/javascript" src="js/swfobject.js"></script>
</head>

<div id="ZoomerFlash">
<!-- this appears if user doesn't have JavaScript enabled, or doesn't
have the required Flash Player version -->
<p>Please upgrade to the latest version of <a
href="http://www.adobe.com/go/getflashplayer/" target="_blank">Flash
Player</a>.</p>
<p><a href="?detectflash=false">Click here</a> if you already have Flash
Player installed.</p>
</div>
		
<script type="text/javascript">
// <![CDATA[

var so = new
SWFObject("http://is.netshops.com/images/products/360_spin/master360.swf
", "master360", "400", "400", "7", "#FFFFFF", true);
so.addVariable("skuXML",
"http://is.netshops.com/images/products/360_spin/WES220001");
so.addParam("allowScriptAccess", "always");
so.write("ZoomerFlash");

// ]]>
</script>

Or 

<script type="text/javascript">
// <![CDATA[

var so = new
SWFObject("http://is.netshops.com/images/products/360_spin/master360.swf
?skuXML=http://is.netshops.com/images/products/360_spin/WES220001",
"master360", "400", "400", "7", "#FFFFFF", true);
so.addParam("allowScriptAccess", "always");
so.write("ZoomerFlash");

// ]]>
</script>


Paul Lugo
Sr. Web Designer, Site Usability and Design
 
NetShops, Inc.
12000 I Street, Suite 20-200
Omaha, NE 68137
Telephone: (402) 504-9820 ext.1323
Fax: (402) 934-9541
www.netshops.com
 



More information about the Swfobject mailing list