A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: embeding flash the correct way

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Posts
    6

    embeding flash the correct way

    Hi all,

    I'm a noob to flash so apolygies in adavnce.I dont understand a couple of things on how to embed my flash correctley, hope someone can help me.
    In my HTML code my flash is currently as follows:

    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="207" height="289" align="left">
    <param name="movie" value="MENU2.swf" />
    <param name="quality" value="high" />
    <embed src="MENU2.swf" width="207" height="289" align="left" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
    </object>

    After reading the guide from what I get i have to replace it with this:

    <script type="text/javascript" src="swfobject.js"></script>

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

    <script type="text/javascript">
    var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7", "#336699");
    so.write("flashcontent");
    </script>

    My questions are as follows:
    1.In the guide it says 'Simply include the swfobject.js Javascript file'...where? i have it in the root foder. is this ok? or does it somehow need to be attached to the page?
    2.In the script above it says
    '<div id="flashcontent">
    This text is replaced by the Flash movie.
    </div>'
    I dont understand what it means by 'This text is replaced by the Flash movie.'
    Does it mean the name of the movie? how would I write it? also what does it mean by flashcontent, do i replace this?
    3. Which parts of my code thats im now using do i need to change with the new code? all of it? or parts?

  2. #2
    Member
    Join Date
    Nov 2003
    Location
    Iowa
    Posts
    42
    Ok, This is not too tough, if you have something like Dreamweaver to help you out. But If you want to do it straight code here is how it is:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Your Title</title>
    </head>
    
    <body>
    <table width="100%" border="0" cellspacing="0" cellpadding="20">
      <tr>
        <td>
    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="207" height="289" align="left">
    <param name="movie" value="MENU2.swf" />
    <param name="quality" value="high" />
    <embed src="MENU2.swf" width="207" height="289" align="left" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
    </object>
        </td>
      </tr>
    </table>
    </body>
    </html>
    Now, if you want any proper aligning to the left , right center or otherwise, you'll have to properly do so either with tables or css (I suggest learning CSS if you are looking into doing more with the web)

    To answer your questions:

    1. I have no idea what the .js file is for unless you are following some sort of tutorial which requires it. If this is the case, look at the original tutorial hierarchy to determine what folder (if any ) is necessary to place the .js file.

    2. "<div id="flashcontent"></div>" is a div tag that surrounds where your flash should be going. The div tag is defined by your CSS file.

    3. the above code will work as long as you have your .swf file in the same directory (hierarchy) as the html file that you write this to.

    Hope this helped!
    - SageMaven -

  3. #3
    Junior Member
    Join Date
    Jan 2007
    Posts
    6
    thanks for the help, im still stuck though,
    the guide im using is http://blog.deconcept.com/flashobject/

    Im using dreamweaver not straight code so im unable to use that. Or i just dont know how.

    im not sure what ive got to change on my code, to embed flash correctly which is;
    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="207" height="289" align="left">');
    <param name="movie" value="MENU2.swf" />
    <param name="quality" value="high" />
    <embed src="MENU2.swf" width="207" height="289" align="left" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
    ('</object>

    and the guide says use

    <script type="text/javascript" src="swfobject.js"></script>

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

    <script type="text/javascript">
    var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7", "#336699");
    so.write("flashcontent");
    </script>

    with the js file which i have uploaded to my root folder.

    im not sure which parts to replace and which parts to leave.
    the only reason im doing this is to get rid of the IE 'click to activate box'

    any help appericated

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center