Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2006
    Thanked 0 Times in 0 Posts

    swfobject multiple movies on page..

    Below is the code i generated. What if I have multiple flash movies on page? Do i use same script, and if so, do i need another id or need to make other modifications for other movies on page?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    swfobject.registerObject("myFlashContent", "9.0.0");
    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="myFlashContent">
    <param name="movie" value="MainMovie.swf" />
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="MainMovie.swf" width="800" height="600">
    <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" />
    <!--[if !IE]>-->

  2. #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Thanked 2,250 Times in 2,237 Posts
    do i need another id or need to make other modifications for other movies on page?
    Yes, make another element with a different id(say myFlashContent1,myFlashContent2 etc, since you can't use the same id for multiple elements inside a document), and then include the function calls like
    <script type="text/javascript">
    swfobject.registerObject("myFlashContent1", "9.0.0");
    swfobject.registerObject("myFlashContent2", "9.0.0");
    swfobject.registerObject("myFlashContent3", "9.0.0");
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


Posting Permissions

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