Solved

XML problem with Internet Explorer

Posted on 2010-09-10
7
45 Views
Last Modified: 2016-05-12
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
Comment
Question by:vpanjabi
  • 3
7 Comments
 
LVL 11

Accepted Solution

by:
petiex earned 500 total points
ID: 33648763
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
 

Author Comment

by:vpanjabi
ID: 33649528
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
 
LVL 11

Expert Comment

by:petiex
ID: 33650699
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
 
LVL 11

Expert Comment

by:petiex
ID: 34845198
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

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
XSL - change date format 3 45
Adding a hidden div to each row in a table 6 71
Windows Tool to Build Android and iOS App 3 76
Create html table using xsl 8 36
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question