Hi all,
in my ongoing quest to mess up anything I do in Flash, I have come across a beaut.
I have a SWF that only plays in IE6 when I refresh the page... All other browsers work fine and happily. The problem gets weirder when I call in a second SWF into the main movie clip. Only after refreshing again will the second SWF play...
I have set up swfobject to only be called on page load as well, so it's not the JavaScript being funny...
It strikes me that it's not in my AS as all other combinations of browsers and OS's work, but I am at a complete loss.
And of course, the only person who has IE6 in the office is the big boss, hence my concern.
Anyone come across anything like this before?
Do you have a URL? Or source code? I have IE6 on the laptop...
And this problem sounds familiar, I'll try to remember what I did when it happened to me.
I think it was some javascript clashing- do you have any other onLoad events? Are you using Lightbox on the same page?
I have stripped out all non-essential JavaScript... Will have another go with only swfobject included.
EDIT: OK. even with all JS apart from swfobject out, there's no change.
Source code for page follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Magnum Maxcellence.
<meta name="keywords" content="Magnum, Origins, Java, Choc, Milk, Colombia, columbia, Aroma, home, worshipper, ice cream, chocolate, new, competition, 1 winner 4 friends 5 countries, Ola,ice cream, ice cream accessories, ice cream ball, ice cream cart, ice cream chocolate, ice cream cups, ice cream distributor, ice cream history, ice cream maker, ice cream makers, ice cream recipe, ice cream sandwich, ice cream social, ice cream spoons, ice cream sundae, ice cream sundaes, ice cream toppings, make ice cream, making ice cream, new ice cream, rival ice cream maker, soft ice cream, soft serve ice cream maker, vanilla ice cream,www.mymagnum.co.za"/>
<meta name="description" content="Discover the new range of beyond sublime Magnum Origins, with heavenly ingredients from around the globe. I’m a worshipper, are you?" />
<script src="includes/js/common.js" type="text/javascript" charset="utf-8"></script>
<script src="includes/js/swfobject.js" type="text/javascript" charset="utf-8"></script>
<script src="jsflashkit/JavaScriptFlashGateway.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css" media="all">@import url(includes/css/default.css);</style>
<style type="text/css" media="screen">
#mainContainer {
width: 995px;
height: 610px;
padding: 0px; }
#noFlashContent {
width: 995px;
height: 610px; }
#innerDiv {
width: 750px;
background: url(/images/bg_main.jpg) no-repeat;
font-family: verdana;
font-size: 80%;
color: #a08041;
padding-top: 245px;
margin: 50px auto }
a,
a:visited { color: #a08041 }
</style>
</head>
<body>
<div id="mainContainer">
<div id="noFlashContent">
<div id="innerDiv">
<noscript>
Please turn on Javascript<br /><a href="index.html?detectflash=false">Click here if you have Flash Player 8 and wish to continue</a>
</noscript>
A minimum of Flash Player 8 is required to view the site.<br />
<a href="http://store.adobe.com/go/getflashplayer" target="_blank">Click here to install the newest version of Flash Player</a><br />
</div>
</div>
</div>
<div id="made_by">© MAGNUM<br /> <a href="http://www.liquorice.co.za" target="_blank" >Created by Liquorice.co.za</a></div>
<script type="text/javascript" charset="utf-8" defer="defer">
// <![CDATA[
var uid = new Date().getTime();
var flashProxy = new FlashProxy(uid, 'jsflashkit/JavaScriptFlashGateway.swf');
var so = new SWFObject("flash/application.swf?t=<?php print time(); ?>", "maxcellence", "995", "600", "8","#000000");
so.addParam("menu", "false");
so.addParam("quality", "high");
so.addParam("allowScriptAccess","always");
// Used for the Flash Javascript interaction ------------------------------
so.addVariable('lcId',uid);
so.addVariable("flashRoot", "flash/");
so.write("noFlashContent");
var DOCUMENTGROUP = 'Main';
var DOCUMENTNAME = 'Home Page';
var ACTION = '';
// var FLASHURL = '';
// ]]>
</script>
<!-- Flash Tracking Code v4.00 - All rights reserved -->
<a name="IT" href=""></a><script type="text/javascript" src="/includes/js/flashtracking.js"></script>
<noscript><div><img src="http://stats.indexstats.com/p.pl?a=1000386179291&js=no" width="1" height="1" alt="" /></div></noscript><!--//-->
<!-- End of Flash Tracking Code -->
</body>
This is the javascript in the common.js file:
function openPopup(href) { window.open(href, "popup","menubar=0,scrollbars=0,resizable=0,width=1000,height=660"); }
function goToCompetition() { // Get the Flash application to go to the competition entry form using the // JavaScriptFlashGateway Kit flashProxy.call('changeScene', 'xml/entryform.xml'); }
I have validated the code against the W3C Validator and it's all happy shiny...
My ulcer is starting to kill me...
Hmmm. In other news, it works fine on my local machine.
I have just tested it in Opera 9.5 and the remote version doesn't work, but the local does.
I have tried adding the URL to my Flash settings trusted sites, but no difference.
Does this look like a scriptaccess issue? If so, why am I not getting a warning?
Ok, problem found- not entirely sure of the solution though.
I copied your source, hosted it locally, and viewed in IE6. However, I did a find'n'replace for "src=" with "src="http://www.mymagnum.co.za"
This then workied 1st time in IE6
Further investigation showed me that the find'n'replace broke the "Flash Tracking Code v4.00"- and when I fixed the src attribute of that code, the page once again did not work in IE6
So, what I would suggest, would be to replace the use of "window.onload" in the /includes/js/flashtracking.js file with some clever useage of Simon Wilson's additional onload athttp://simonwillison.net/2004/May/26/addLoadEvent/
Thanks for the glimmer of hope!
I have tried removing all the flashtracking crap and even without it on the page, I still have the issue on the server, but not locally.
I have tried removing all extraneous JS and according to FireBug I am not missing any files (using the network profiler).
And locally, I have no problem...
It seems the problem is confined to IE6 and Opera 9.5. Which is not really helping me at the moment.
I will keep digging. About to start wading through the horrid, horrid ActionScript to see if there's any scriptaccess funnies.
AAAAAAAAAAAAAAARGH!
I am 100% certain that it is a javascript conflict, not an actionscript error.
Are you sure the cache is clear when you are testing?
Yep. I have stripped everything down to just the HTML and the flash file... I am starting to think it's a server configuration issue, that's how desperate I am.
At the moment I am uploading to a different server to see how that theory pans out.
It was the server. I kid thee not.
I am in the process of checking the apache config etc. and if I find anything concrete, I'll post it here.
EDIT:
Still nothing to report, but if you are ever considering hosting a Flash-based site with Hetzner (www.hetzner.co.za), then I can definitly heartily recommend you don't use their "Basic" package... Site works fine on the dedicated server we have from them so it is in the process of being transferred across.