Solved

XML problem with Internet Explorer

Posted on 2010-09-10
7
58 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

632 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