• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 73
  • Last Modified:

XML problem with Internet Explorer

HI. We have implemented the  below code (which is a banner rotator from flashXML.net) on one of our sites and it  works fine iwith Internet Explorer on the web server (windows 2008/IIS 7) but does ont work properly with with Internet Explorer outside (even on the same LAN). It shows up after a delay. However, the code works fine from outside the server with other browsers (Firefox, Safari). Can you help us with this wierd problem?

Thanks in Advance. Here is the relevant code:(for the SWF object):

<div id="ste_container_FlashImageRotator" style="min-height: 20px; zoom: 1 !important; padding: 0px; margin: 0px;">

<div class="ContentItemButtonPanel">

                                </div>
<object id="imagebanner" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="720" align="middle" height="260">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="/webparts/banner/banner.swf/webparts/banner/banner.swf" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="bgcolor" value="#ffffff" />
<param name="flashvars" value="settingsXML=/webparts/banner/settings.xml" />
<embed src="/webparts/banner/banner.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="720" height="260" name="banner" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" flashvars="settingsXML=/webparts/banner/settings.xml" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object></div>
0
vpanjabi
Asked:
vpanjabi
  • 3
1 Solution
 
petiexCommented:
There is a javascript workaround for the way Internet Explorer treats Flash.

If you have a Flex framework downloaded, the template is in <FLEX_HOME>/templates/swfobject

Otherwise, basically, you need the swfobject.js script, available here: http://code.google.com/p/swfobject/
and then the basic template looks like this (replace all the ${variable} items with your desired values, either manually or with an ant script):


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
    <!-- 
    Smart developers always View Source. 
    
    This application was built using Adobe Flex, an open source framework
    for building rich Internet applications that get delivered via the
    Flash Player or to desktops via Adobe AIR. 
    
    Learn more about Flex at http://flex.org 
    // -->
    <head>
        <title>${title}</title>         
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
			 don't display flashContent div so it won't show if JavaScript disabled.
		-->
        <style type="text/css" media="screen"> 
			html, body	{ height:100%; }
			body { margin:0; padding:0; overflow:auto; text-align:center; 
			       background-color: ${bgcolor}; }   
			#flashContent { display:none; }
        </style>
		
		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
        <!-- BEGIN Browser History required section ${useBrowserHistory}>
        <link rel="stylesheet" type="text/css" href="history/history.css" />
        <script type="text/javascript" src="history/history.js"></script>
        <!${useBrowserHistory} END Browser History required section -->  
		    
        <script type="text/javascript" src="swfobject.js"></script>
        <script type="text/javascript">
            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
            var xiSwfUrlStr = "${expressInstallSwf}";
            var flashvars = {};
            var params = {};
            params.quality = "high";
            params.bgcolor = "${bgcolor}";
            params.allowscriptaccess = "sameDomain";
            params.allowfullscreen = "true";
            var attributes = {};
            attributes.id = "${application}";
            attributes.name = "${application}";
            attributes.align = "middle";
            swfobject.embedSWF(
                "${swf}.swf", "flashContent", 
                "${width}", "${height}", 
                swfVersionStr, xiSwfUrlStr, 
                flashvars, params, attributes);
			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
        </script>
    </head>
    <body>
        <div id="flashContent">
        	<p>
	        	To view this page ensure that Adobe Flash Player version 
				${version_major}.${version_minor}.${version_revision} or greater is installed. 
			</p>
			<script type="text/javascript"> 
				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
			</script> 
        </div>
	   	
       	<noscript>
            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
                <param name="movie" value="${swf}.swf" />
                <param name="quality" value="high" />
                <param name="bgcolor" value="${bgcolor}" />
                <param name="allowScriptAccess" value="sameDomain" />
                <param name="allowFullScreen" value="true" />
                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
                    <param name="quality" value="high" />
                    <param name="bgcolor" value="${bgcolor}" />
                    <param name="allowScriptAccess" value="sameDomain" />
                    <param name="allowFullScreen" value="true" />
                	<p> 
                		Either scripts and active content are not permitted to run or Adobe Flash Player version
                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
                	</p>
                    <a href="http://www.adobe.com/go/getflashplayer">
                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
                    </a>
                </object>
            </object>
	    </noscript>		
   </body>
</html>

Open in new window

0
 
vpanjabiAuthor Commented:
Thanks petiex. If this as the problem, why would it work with IE on the web server itself? Shouldn't that have not worked as well?
0
 
petiexCommented:
I first heard about the swfobject workaround when IE made a security update that required you to click on a flash file before you could use any interactive features. It puts a tooltip over the flash movie, “Click to activate and use this control.“ Using swfobject makes that go away. Possibly the security measure is considered unnecessary when the client is on the same server as the swf. I don't know.

I can't guarantee using the swfobject script will solve your problem, but I figure it's worth a try.
0
 
petiexCommented:
Creating the swf object with the swfobject javascript (dynamic publishing) should address the issue that IE has with statically published (using html object tags) Flash, which seems to be the issue described in this question. The html template that Adobe provides with the Flex framework uses it, as do any interactive flash sites that have to work with older versions of IE.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now