...

View Full Version : swfobject dynamic multiple on page



durangod
08-01-2011, 02:55 AM
Hi i just switched over from 1.5 to 2.2 swfobject.

in my admin area only the first video is showing on the page, but on the user side they all show up just fine, same code.. strange.

but anyway i was reading this..

http://groups.google.com/group/swfobject/msg/031e29c96933dfa0

and it confused me alittle because i have no idea how many vids are going to be display, i have them displaying from a loop.

i guess what the article is saying is that you have to call javascript for every one your going to display and use a dif label name for it.

but as i said i have no clue, am i suppose to list that 100 times on the page in case i have 100 videos...

javascript is really not my cup of tea lol...


here is my code..

in the head i have this ...



<!-- added for swfobject 2.2 -->
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("player", "9.0.0");
</script




and then in the body i have this.. and like i said there might be 100 vids but it only shows the first one.





begin the loop then do this

<div style="float:left;">

<table border="0" align="left"><tr>

<td align="center"><td align="center"><?=$sql_array->vid_name?><br />



<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="175" height="175" id="player" name="player" align="middle">
<param name="movie" value="player.swf" />
<param name="play" value="false" />
<param name="quality" value="high" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=<?=$CONST_LINK_ROOT?>/movies/<?=$sql_array->vid_id?>.flv" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="player.swf" width="175" height="175" align="middle">
<param name="play" value="false" />
<param name="quality" value="high" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=<?=$CONST_LINK_ROOT?>/movies/<?=$sql_array->vid_id?>.flv" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>

</td></tr></table>
</div>


loop again till done...


so what do i do to show multiples on a page.

durangod
08-01-2011, 03:21 AM
hot dam i got it... i know very little about javascript but i took a guess and it works..

i changed this line to add the loop key to id and name labels.



<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="175" height="175" id="player[$k]" name="player[$k]" align="middle">





Question: now even though it is working, did i do this right folks or not?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum