views:

336

answers:

1

So I'm simply trying to prevent a flash video from playing on page load but have so far been unsuccessful. The code in question is as follows:

<div id="flashcontent">This text is replaced by the Flash movie.</div>
<script type="text/javascript">

var so = new SWFObject("link_to_video","mymovie", "350", "400", "8", "");

so.addParam("play","false");          
so.write("flashcontent");

</script>

with link_to_video of course actually being a real link. The video plays just fine, but with or without that addParam it plays on page load. The code is using a local version of SWFObject that's at version 1.5, but as far as I can tell the addParam function is available in 1.5. Upgrading to 2.0 is not a desirable solution.

+1  A: 

Is your video an actual Flash movie with animations on the main timeline? That's the only thing that the play parameter will actually control. If your SWF is a video player of some sort then the play parameter won't actually do anything. Instead, you'll probably use addVariable and then look for that variable inside of your SWF (in AS3 it's in the Stage's loaderInfo object) and use that value to determine if the video auto-plays or not.

Branden Hall
I don't know if its an actual flash movie or if its a video player, how does one tell? The file is in the .swf format and on the website it has player controls and the video itself references another file that contains player controls. When you say use addVariable, you mean use it in a similar way that I tried to use addParam? And as for looking for the variable inside the swf, how is that done? I can't seem to find any programming options if I open the swf in Adobe Flash CS3. Is this going to require recreating the swf from the flv? Sorry for all my confusion, I am brand new to flash :)
Trajanus