The guy who built the website before me put in the following code, which applies to our homepage video. Basically, the idea is to play one flash file that has autoPlay set to True (Erin.swf) when the user first visits the page, and then another flash file that has autoPlay set to False (Erin_falseAutoPlay.swf) each time thereafter. At one point, this code was working, when we had a different set of videos. Now that we've created these others, however, it's no longer the case. Can anyone offer assistance?

<script type="text/javascript"> if(window.navigator.userAgent.indexOf('MSIE
7.0') != -1||window.navigator.userAgent.indexOf('MSIE
8.0') != -1){   swfobject.embedSWF("<?php echo JURI::base(); ?>media/ct_animated.swf", "logo", "236", "75", "9.0.0");   swfobject.embedSWF("<?php echo JURI::base(); ?>media/ct_static.swf", "logoStatic", "236", "75", "9.0.0");   <?php   if(isset($_COOKIE['centraltechmain'])) {        echo "swfobject.embedSWF(\"/media/Erin.swf\", \"homePageVideo\", \"208\", \"240\", \"9.0.0\");";    }   else {      echo "swfobject.embedSWF(\"/media/Erin_falseAutoPlay.swf\", \"homePageVideo\", \"208\", \"240\", \"9.0.0\");";  }   setcookie("centraltechmain", "videoPlayed", time()+3600);   ?> }

if(window.navigator.userAgent.indexOf('MSIE
6.0') != -1){   $(window).load(function (){         swfobject.embedSWF("<?php echo JURI::base(); ?>media/ct_animated.swf", "logo", "236", "75", "9.0.0");       swfobject.embedSWF("<?php echo JURI::base(); ?>media/ct_static.swf", "logoStatic", "236", "75", "9.0.0");       <?php       if(isset($_COOKIE['centraltechmain'])) {            echo "swfobject.embedSWF(\"/media/Erin.swf\", \"homePageVideo\", \"208\", \"240\", \"9.0.0\");";        }       else {          echo "swfobject.embedSWF(\"/media/Erin_falseAutoPlay.swf\", \"homePageVideo\", \"208\", \"240\", \"9.0.0\");";      }       setcookie("centraltechmain", "videoPlayed", time()+3600);       ?>  });     }   else {      swfobject.embedSWF("<?php echo JURI::base(); ?>media/ct_animated.swf", "logo", "236", "75", "9.0.0");       swfobject.embedSWF("<?php echo JURI::base(); ?>media/ct_static.swf", "logoStatic", "236", "75", "9.0.0");       <?php       if(isset($_COOKIE['centraltechmain'])) {            echo "swfobject.embedSWF(\"/media/Erin.swf\", \"homePageVideo\", \"208\", \"240\", \"9.0.0\");";        }       else {          echo "swfobject.embedSWF(\"/media/Erin_falseAutoPlay.swf\", \"homePageVideo\", \"208\", \"240\", \"9.0.0\");";      }       setcookie("centraltechmain", "videoPlayed", time()+3600);       ?>  } </script>

3 answers

0
points

Maybe it's not working because your JavaScript is dying alt text

Answered about 4 years ago by Nathan Duran
0
points

Thanks for the help, guys. I decided to switch from swfobject to flashembed (from jquery tools). Cuts down on the code needed (sort of) but doesn't really fix my problem.

Answered about 4 years ago by Micah Choquette
0
points

So youre saying only the SWF files are changed.. (e.g. code is unchanged)?

Why not using the "play" and "loop" parameters from swfobject?

Does PHP output the expected result (cookies are set properly)?

Answered about 4 years ago by Roland Franssen