4 Replies Latest reply on Dec 16, 2010 10:16 AM by Technohedge

    Flash alternative content problem

    Technohedge Level 1

      Hi guys! Im havin a lil bit of a problem getting my flash objects to show alternative content and wondered if anyone can see where im going wrong.

       

      Im using the HTML generated from flash player itself to embed the .swf files ( I tried SWFObject but couldnt get it to work!) and then uploading the swf to my site host. this works fine but when i try to add any alternative content it dosent work or shows the alternate content instead of the swf file. Here is the code im embedding in my sites pages, can anyone tell me how to write alternate content into this?

       

      Any help appreciated!

       

      Dave

       

      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>photogallery test3</title>
      </head>
      <body bgcolor="#ffffff">
      <!--url's used in the movie-->
      <!--text used in the movie-->
      <!-- saved from url=(0013)about:internet -->
      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="2000" height="2000" id="photogallery test3" align="middle">
      <param name="allowScriptAccess" value="sameDomain" />
      <param name="movie" value="photogallery test3.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="photogallery test3.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="2000" height="2000" name="photogallery test3" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
      </object>
      </body>
      </html>
        • 1. Re: Flash alternative content problem
          adninjastrator Level 4

          Well first off, any code auto generated by Flash is junk, don't use it. Any code auto generated by DreamWeaver is junk, don't use it.

          Learn to hand code a little bit and you'll have much more control and it will be done right.

          Using swfobject and alt content is a topic near and dear to my heart, and I've written many posts detailing how.... so my advice...Go back to using swfobject. But to make it simple, use swfobject.js version 1.5, not the latest version.

          If you can't find it else where on the Internet, you can download from my site here:

          http://www.cidigitalmedia.com/swfobject.js

          Put that file in a folder where you can find it and path to it in your <head> like this:

           

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

           

          of course be sure to edit the path so it works on your site.

          The idea of using swfobject is that if it detects the Flash plugin, it will replace the "alt content" with the Flash content. This applies to just one <div>, the container which will hold your Flash content.

          The good part is, that one <div> can contain any number of child <div>s, any type of HTML text, anchor links, images, lists, even another type of media player... so that your Flash video will play on an iPhone (actually it's the alt content video that plays, but the viewer doesn't know that).

          Great for SEO, provides alt navigation to other pages if needed, plus, can get your Flash stuff into the iPhone... sort of anyway.

          So when laying out your Web page, create the <div> that will eventually hold your Flash. Then create ALL the all content... and don't skimp..SEO is important so use plenty of text...you could even include a complete text narration of a video.

          So get all the alt content finished and displaying correctly FIRST, before you try to add the Flash. Once you've got that, then add the <script> that swfobject is expecting. It will look something like this:

           

          <div id="slide_show" />

           

          All your alt content goes here... any type of html can be put here, text, images, links list, etc.


                  <script type="text/javascript">
            // <![CDATA[
            var so = new SWFObject("slide_show/hie_ss_new.swf", "slide_show", "350", "310", "8", "#ffffff");
            so.addParam("wmode", "transparent");
            so.write("slide_show"); 
            // ]]>
            </script>
                  <!-- close slide_show -->
              </div>

           

          of course edit the params to fit your site.

          More discussions here:

          Create a unique word in your alt content to measure how long it takes Google to index the alt content:

          http://board.flashkit.com/board/showthread.php?t=819299

          Flash and SEO (alt content):

          http://board.flashkit.com/board/showthread.php?t=819134

          Compare Flash displayed on Web page with alt content in source code:

          http://www.ksowetsuits.com/

          Flash that plays on iPhone (or at least the alt content does), also illustrates how to sandwich Flash between 2 layers of HTML:

          http://www.cidigitalmedia.com/tutorials/qt/play_qt.html

          View the source code to see how it's done.

           

          Alt content?? I'M ALL FOR IT!!

          Best wishes,

          Adninjastrator

          • 2. Re: Flash alternative content problem
            Technohedge Level 1

            Hey Adninjastrator, Thanks for the info. I have done all this previously with SWF Object 2.0, just had a go with the 1.5 version and still having no luck. Heres what Ive done:

             

            Uploaded the swfobject.js file to my root directory.

             

            Put the following in the head of my page: <script type="text/javascript" src="swfobject.js"></script>

             

            uploaded a file called 'cracktest.swf' (also to the root directory)

             

            And added the following to the HTML in the page:

             

             

                 <script type="text/javascript">
              // <![CDATA[
              var so = new SWFObject("cracktest.swf", "cracktest", "350", "310", "8", "#ffffff");
              so.write("cracktest"); 
              // ]]>
              </script>
                    <!-- close slide_show -->
                </div>

             

            Still coming up with nothing. Is there something daft Im missing?

             

            Dave

            • 3. Re: Flash alternative content problem
              adninjastrator Level 4

              Ah yes...

              swfobject works by replacing the content of a <div>,

               

              so.write("cracktest");

              it will not write cracktest, the ,swf, it will rewrite the contents of your <div>

              you are asking it to replace the contents of a <div id="cracktest">

              Is that the id given to that <div>?

               

              If not, change the "so.write" to the id name given to the <div> holding your Flash content and it will work.

              Best wishes,

              Adninjastrator

              • 4. Re: Flash alternative content problem
                Technohedge Level 1

                Superstar! This works a treat. Thank you very much!

                 

                Dave