Im trying to load a flash movie using swfobject which i have been successful in doing so however the flash movie takes a few seconds to load. I wanted to show a simple loading animation however the animation never displays. I commented out the code that embeds the movie and found that the animation does get displayed. Has anyone got any ideas how i can sort this. My code is below.
$FlashWrapper.html("<div id='PopUpLoader'>" +
"<img src='images/PopUpAjaxLoader.gif' alt='Ajax Loading Gif' />"+
"<p>Loading...</p>" +
"</div>").flash({
swf: 'Panos/Test.swf',
width:'920',
height:'500',
allowFullScreen: true
});
Thanks in advance
The animation never displays because you are replacing your div immediately after it is created, probably even before it gets rendered. What you should do is to show the animation, possibly in front of the flash that is being loaded, and hide it after it is loaded. The problem is to get an event from flash. SWFObject doesn’t seem to have any onload callback. You probably have to call your JavaScript from Flash using flash.external.ExternalInterface.
See also this thread: How to capture an event trigger when a flash movie successfully loaded?