Monday, 26 November 2012

Embedding Adobe Flash object in html - Movie not loaded...

Recently I had to embed flash (.swf) banner into html web page. After inserting  this code below, I've got only background of my banner displayed, but no flash! Right-clicking on it, it showed me "Movie not loaded".



<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="myflash" align="middle" height="200" width="750">
<param name="movie" value="myflash.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#017783">
<param name="play" value="true">
<param name="loop" value="true">
<param name="wmode" value="window">
<param name="scale" value="showall">
<param name="menu" value="true">
<param name="devicefont" value="false">
<param name="salign" value="">
<param name="allowScriptAccess" value="sameDomain">
<!--[if !IE]>--> <object type="application/x-shockwave-flash" data="myflash.swf" height="200" width="750">
<param name="movie" value="myflash.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#017783">
<param name="play" value="true">
<param name="loop" value="true">
<param name="wmode" value="window">
<param name="scale" value="showall">
<param name="menu" value="true">
<param name="devicefont" value="false">
<param name="salign" value="">
<param name="allowScriptAccess" value="sameDomain">
<!--<![endif]--> <a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Download Adobe Flash Player">
</a>
<!--[if !IE]>--> </object>
<!--<![endif]--> </object>
</div>

The solution was easy  - it was a question of permissions, for flash "execute" permission for your site folders should be enabled.
You should put your .swf file into public directory (in my case it was root of the site folder). Don't forget that permissions of the folders you put your flash in influence the permissions of a file! Which siply means all folders which are in the link to your flash should have permission 777.
I had to change the link to the .swf file in my code changing the line <object type="application/x-shockwave-flashdata="myflash.swfheight="200width="750">

And also important - the link in flash file is embedded, so if it wrong there is no way you can fix it without having flash project to export swf file again. If you know some solution, please post in comment!

No comments:

Post a Comment