我不確定我是否理解這個問題。但是如果你想讓happy.jpg加載happy.swf和tensed.jpg來加載tensed.swf,那麼你只需隨機生成數字,切換情況並加載這兩個文件。這樣會更容易
<?php
$mood = rand(1,5);
switch($mood){
case '1':
{ echo "<img src='happy.jpg'>";
<object width="810" height="1078" data="Rightside.swf" type="application/x-shockwave-flash">
<param value="http://www.eviltwin.tv/wp/excited.swf" name="movie">
<param value="high" name="quality">
<param value="#ffffff" name="bgcolor">
<param value="true" name="play">
<param value="true" name="loop">
<param value="transparent" name="wmode">
<param value="showall" name="scale">
<param value="true" name="menu">
<param value="false" name="devicefont">
<param value="lt" name="salign">
<param value="sameDomain" name="allowScriptAccess">
<!--<![endif]-->
You don't have flash, we won't hold it against you though.
<!--[if !IE]>-->
</object>
break;}
case '2':
{
echo "<img src='excited.jpg'>";
<object width="810" height="1078" data="excited.swf" type="application/x-shockwave-flash">
<param value="http://www.eviltwin.tv/wp/excited.swf" name="movie">
<param value="high" name="quality">
<param value="#ffffff" name="bgcolor">
<param value="true" name="play">
<param value="true" name="loop">
<param value="transparent" name="wmode">
<param value="showall" name="scale">
<param value="true" name="menu">
<param value="false" name="devicefont">
<param value="lt" name="salign">
<param value="sameDomain" name="allowScriptAccess">
<!--<![endif]-->
You don't have flash, we won't hold it against you though.
<!--[if !IE]>-->
</object>
break;}
我希望這給你一個想法。剛剛從您的網站獲得嵌入代碼,請原諒長代碼。 :)