Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts

    swfobject dynamic multiple on page

    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/swfob...1e29c96933dfa0

    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 ...

    Code:
         <!-- 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.


    Code:
    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.

  • #2
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    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.

    Code:
    <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?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •