I am trying to load a flash movie after the dom content has loaded. For this I use jQuerys document ready functionality. But the flash won’t load if it’s inside of the document ready. It will load on the outside.
Most basic version of the code.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="js/swfobject.js"></script>
</script>
<body>
<div id="uploader-1"></div>
</body>
<script>
$(document).ready(function() {
var i =1;
flashElement = $('#uploader-1');
var swfVersionStr = "11.1.0";
var flashvars = {"x": 10, "y": 12};
var params = {"wmode": "transparent"};
params.quality = "high";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "false";
var attributes = {};
attributes.id = "uploader-1";
attributes.name = "uploader-1";
attributes.styleclass = "uploader";
swfobject.embedSWF(
"flash/Uploader.swf", "uploader-1",
'1000px', '1000px',
swfVersionStr, false,
flashvars, params, attributes);
swfobject.createCSS("#uploader-1", "position: absolute; left: 10px; top: 10px; width: 1000px; height:1000px;");
});
</script>
If I run this exact code without the doc ready. it works. (also it might be worth mensioning that when inspecting the source the dom is exactly the same) Any suggestions? I tried searching both SO and google but have not found anything similar to this. Issue appears in IE8
Finnaly solved it. it seemed to be a cache issue loading an old, old, old version of the movie.