views:

370

answers:

1

I'm having issues with loading a SWF that references external SWF files...

The main SWF loads fine if the HTML file is in the same folder as all the SWFs using the following code:

<script type="text/javascript" src="../js/swfobject.js"></script>
<script type="text/javascript">
    var flashvars = {};
    var params = { allowScriptAccess: "always" };
    params.quality = "high";
    params.wmode = "transparent";
    var attributes = {id:"IDofSWF", name:"IDofSWF"};
    swfobject.embedSWF("event_so_js.swf", "flashContent", "700", "400", "7.0.0", false, flashvars, params, attributes);</script>
</head>

<body>

<div id="flashContent">    <object data="event_so_js.swf"
 name="IDofSWF" id="IDofSWF" type="application/x-shockwave-flash" 
width="700" height="400"></object></div>

But as soon as I move the HTML file out of that folder to the root folder and update the links, it doesn't load correctly - it seems that it's having trouble with the external SWF files. I did have it successfully load one of the external SWF files directly, but it's having trouble with the main SWF. All of the SWF files are in the same folder, so I don't know why it's having issues. Here's the code for the HTML file when it's in the root folder:

<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
    var flashvars = {};
    var params = { allowScriptAccess: "always" };
    params.quality = "high";
    params.wmode = "transparent";
    var attributes = {id:"IDofSWF", name:"IDofSWF"};
    swfobject.embedSWF("folio/event_so_js.swf", "flashContent", "700", "400", "9.0.0", false, flashvars, params, attributes);</script>
</head>

<body>

<div id="flashContent">    <object data="folio/event_so_js.swf"
 name="IDofSWF" id="IDofSWF" type="application/x-shockwave-flash" 
width="700" height="400"></object></div>

There is also a link on the page that calls a function in the actionscript using ExternalInterface, so it could be that causing the issues. The code for the link is:

<a href="#" onclick="document.getElementById('IDofSWF').clicky()">

Any help would be awesome, because it's really confusing me.

A: 

Sorted it out...

I updated all the actionscript paths so that they were relative to the location of the html/php file, not the main swf.

wdense51