SWF works, HTML stops external data being loaded?

Hi, second new thread in a few days, sorry for the contant uselessness :slight_smile:

Basically I’m just doing some simple reminder stuff to refresh my brain about flash and have come across a bit of a problem… after hours of thinking my (very simple) actionscript was at fault it looks like it’s something in my JS/HTML implementation.

Could anyone take a look and see what blatently obvious thing I missed? I tried altering the script access variable but… no joy.

Possibly related: I can’t see the JS output code unless i use “select all” then “view selection source”. It’s been a while since I used JS though so maybe it always did that and I didn’t realise?


<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" />

<script type="text/javascript">
if (location.search !== "")
	{
	var queryString = location.search;
	var clean = "?";
	queryString = queryString.replace(clean,"");
       	var part1 = "
<PARAM NAME='FlashVars' value=\"";
       	var part2 = "\">";
	var build = part1+queryString+part2;
	

	var partA  = "<embed src=\"SWFs/imageviewer.swf?";
	var partB  = "\" loop=\"false\" menu=\"false\" quality=\"high\" scale=\"noborder\" wmode=\"opaque\" bgcolor=\"#ffffff\" width=\"800\" height=\"600\" name=\"imageviewer\" align=\"top\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
	var build2 = partA+queryString+partB;
	var check = true;
	}
	else
		{
		var check= false;
		}
</script>

<title>imageviewer</title>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<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="800" height="600" id="imageviewer" align="top">
<param name="allowScriptAccess" value="always" />

<script>
if (check==true) 
	{ document.write(build);}
	else
		{alert("No image selected!");}
</script>

<param name="movie" value="SWFs/imageviewer.swf" />
<param name="loop" value="false" /><param name="menu" value="false" />
<param name="quality" value="high" /><param name="scale" value="noborder" />
<param name="wmode" value="opaque" /><param name="bgcolor" value="#ffffff" />

<script>
document.write(build2);
</script>

</object>
</body>
</html>

Thanks for any help (again)

  • Psaldorn

Edit: I’m just checking to see if the order I get JS to print out the embed etc tags are cauing it… seems odd that it does it in IE and FIrefox though…

**Edit 2: It seems that if I put the HTML file in my FLA folder and then reference the SWF with “…/SWF/myswf.swf” the images are loaded successfully (this is both with publish generated HTML AND my JavaScript HTML)

Yet if I put the HTML in the top layer and access the SWF via “SWF/myswf.swf” it doesn’t load the images. I can’t fathom what teh issue might be :**