[SOLVED] About embed flash

Hi guys,

i have embedded flash in Yii framework,

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="Myflash" width="800" height="600" applicationComplete="init()"


                    <param name="movie" value="Myfalsh.swf" />

                    <param name="quality" value="high" />

                    <param name="bgcolor" value="#869ca7" />

                    <param name="allowScriptAccess" value="sameDomain" />

                    <embed src="<?php echo Yii::app()->request->baseUrl . '/flash/' ?>My flash.swf" quality="high" bgcolor="#869ca7" width="800" height="600" name="Myflash" align="middle"

                           play="true" loop="false" quality="high" allowScriptAccess="sameDomain"

                           type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">



It worked well with firefox and safari, but not in IE8 and IE7.

Can anyone give me any advises to fix it? Thanks a lot!

This is embedding flash in a HTML page not in Yii framework :D

As it’s not Yii related problem… try to google about problems with embedding flash in IE

Thanks for your answering. Actually, when i embedded outside the Yii, it worked fine with IE. But when I took this under Yii’s “views” folder, IE browser couldn’t find the flash file by src’s path(even i changed the path to http site, ex. http://xx.yy/oo.swf). The most curious to me is the code can work fine in Firefox and Safari, so I just want to know where the problem is. Thanks!

The only thing you are using is - <?php echo Yii::app()->request->baseUrl . ‘/flash/’ ?>

Check the source of the generated page (in the browser: view source) to see what value is here and if it’s the same value you use when embedding outside Yii

Yep, the path is the same as my other web site which used Myflash.swf. And I tried to change the authority about flash file to www-data, it’s still couldn’t work. I even tried some clear sample flash files, but still the same result. Sigh…it bothered me for a week long :-[

I don’t get it… why would you change the authority to the flash file if it works when you embed outside Yii…

maybe you need to be a bit more clear…

The flash file is always in the same folder regardless if you are using it from Yii or from a plain HTML file ? If it’s not, it should be!

If it’s in the same folder and if it’s working when you type the path manualy… then it should work even if you PHP echo the value of the path…

If you still don’t get it… post here complete _view.php file and the controller action that renders this view…

You need to download swfobject from official site

and attach swfobject and jquery and change the flashfilename path

and http://www.example.com/



<script type="text/javascript">

var flashfilename = "flash.flv"

var path = "http://www.example.com/flash/"

var flashvars = {};

flashvars.MM_ComponentVersion = "1";

flashvars.skin = "http://www.longtailvideo.com/files/skins/fs40/5/fs40.zip";

flashvars.file = path+flashfilename;

flashvars.autostart = "true";

flashvars.repeat = "always";

var params = {};

params.play = "true";

params.menu = "true";

params.quality = "high";

params.scale = "noscale";

params.salign = "tl";

params.wmode = "opaque";

params.allowfullscreen = "false";

params.allowscriptaccess = "always";

var attributes = {};

attributes.id = "FLVPlayer";

swfobject.embedSWF("http://player.longtailvideo.com/player5.2.swf", "flash", "320", "256", "9.0.0", "http://www.example.com/expressInstall.swf", flashvars, params, attributes);



<div id="flash">

<a href="http://www.adobe.com/go/getflashplayer"> <img alt="Get Adobe Flash player" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" /></a>


Hi all,

 I found where the problem is. It's just my stupid fault. The tag &lt;param&gt;'s value should include th path of the flash file. When i changed &lt;param name=&quot;movie&quot; value=&quot;Myfalsh.swf&quot; /&gt; to &lt;param name=&quot;movie&quot; value=&quot;&lt;?php echo Yii::app()-&gt;request-&gt;baseUrl . '/flash/' ?&gt;Myfalsh.swf&quot; /&gt;. It worked fine. Thanks for all answers&#33;&#33; <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/smile.gif' class='bbc_emoticon' alt=':)' /> 

Glad you solved this… it’s strange that firefox and safari does not need the complete path for the movie param… One more in a big line of IE tips/hacks…