8 Replies Latest reply on Aug 19, 2011 4:15 AM by tomwood2

    How to set up one-button embed-hotlinking for Flash SWF?

    tomwood2

      Hello,

       

      I'm publishing a webcomic in Flash.swf format and I'd like to make it as easy as possible for people to grab my comic and put it on their website. How can I set up one-button hot-linking that will automagically provide the code so that they can easily drop it into their website, similar to the way YouTube does with video?

       

      Thanks,

       

      Tom

        • 1. Re: How to set up one-button embed-hotlinking for Flash SWF?
          kglad Adobe Community Professional & MVP

          you want code that will link to your swf or code to embed your swf on another website?

          • 2. Re: How to set up one-button embed-hotlinking for Flash SWF?
            tomwood2 Level 1

            you want code that will link to your swf or code to embed your swf on another website?

             

            I need the code that will play my SWFs on another website, which I assume would be the embed code. I know how to add a <a href link to point to it, but that won't do what I want.

             

            The challenge seems to be that the best way to embed is using swfobject javascript, but there's no guarantee that every site has that on their site, so I'd need to provide that as well in case it's not on the remote site.

            • 3. Re: How to set up one-button embed-hotlinking for Flash SWF?
              kglad Adobe Community Professional & MVP

              you can use the following.  the bolded lines require you to use appropriate values:

               

                  <div id="flashContent">
                          <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="yourswfwidth" height="yourswfheight" id="swfname" align="middle">
                              <param name="movie" value="http://www.yourdomain.com/path/swfname.swf" />

                              <param name="quality" value="high" />
                              <param name="bgcolor" value="#ffffff" />
                              <param name="play" value="true" />
                              <param name="loop" value="true" />
                              <param name="wmode" value="window" />
                              <param name="scale" value="showall" />
                              <param name="menu" value="true" />
                              <param name="devicefont" value="false" />
                              <param name="salign" value="" />
                              <param name="allowScriptAccess" value="sameDomain" />
                              <!--[if !IE]>-->
                             <object type="application/x-shockwave-flash" data="http://www.yourdomain.com/path/swfname.swf" width="yourswfwidth" height="yourswfheight">
                                  <param name="movie" value="http://www.yourdomain.com/path/swfname.swf" />

                                  <param name="quality" value="high" />
                                  <param name="bgcolor" value="#ffffff" />
                                  <param name="play" value="true" />
                                  <param name="loop" value="true" />
                                  <param name="wmode" value="window" />
                                  <param name="scale" value="showall" />
                                  <param name="menu" value="true" />
                                  <param name="devicefont" value="false" />
                                  <param name="salign" value="" />
                                  <param name="allowScriptAccess" value="sameDomain" />
                              <!--<![endif]-->
                                  <a href="http://www.adobe.com/go/getflash">
                                      <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>
                      </div>

              1 person found this helpful
              • 4. Re: How to set up one-button embed-hotlinking for Flash SWF?
                tomwood2 Level 1

                Right, but how would I program a button in my SWF that will copy that code into the user's clipboard so they can paste it into their website?

                • 5. Re: How to set up one-button embed-hotlinking for Flash SWF?
                  kglad Adobe Community Professional & MVP

                  use the clipboard class.  if you need more help, you'll need to specify as2 or as3.

                  • 7. Re: How to set up one-button embed-hotlinking for Flash SWF?
                    kglad Adobe Community Professional & MVP

                    with as2 you'll need to assign a string to the code i showed which means you'll need to place all that on one line or use a sequence of string concatenations:

                     

                     

                    btn.onRelease=function(){

                    System.setClipboard(s);

                    }

                     

                    var s:String =   '<div id="flashContent">';
                    s+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="yourswfwidth" height="yourswfheight" id="swfname" align="middle">';
                    s+='<param name="movie" value="http://www.yourdomain.com/path/swfname.swf" />';
                    s+='<param name="quality" value="high" />';
                    s+='<param name="bgcolor" value="#ffffff" />';

                    s+='<param name="play" value="true" />';
                    s+='<param name="loop" value="true" />';
                    s+='<param name="wmode" value="window" />';
                    s+='<param name="scale" value="showall" />';
                    s+=' <param name="menu" value="true" />';
                    s+='<param name="devicefont" value="false" />';
                    s+='<param name="salign" value="" />';
                    s+='<param name="allowScriptAccess" value="sameDomain" />';
                    s+='<object type="application/x-shockwave-flash" data="http://www.yourdomain.com/path/swfname.swf" width="yourswfwidth" height="yourswfheight">';
                    s+=' <param name="movie" value="http://www.yourdomain.com/path/swfname.swf" />';
                    s+='<param name="quality" value="high" />';
                    s+='<param name="bgcolor" value="#ffffff" />';
                    s+='<param name="play" value="true" />';
                    s+='<param name="loop" value="true" />';
                    s+='<param name="wmode" value="window" />';
                    s+='<param name="scale" value="showall" />';
                    s+='<param name="menu" value="true" />';
                    s+='<param name="devicefont" value="false" />';
                    s+='<param name="salign" value="" />';
                    s+='<param name="allowScriptAccess" value="sameDomain" />';
                    s+='<a href="http://www.adobe.com/go/getflash">';
                    s+='<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.g if" alt="Get Adobe Flash player" />';
                    s+='</a>';
                    s+='</object>';
                    s+='</object>';
                    s+='</div>';

                    1 person found this helpful
                    • 8. Re: How to set up one-button embed-hotlinking for Flash SWF?
                      tomwood2 Level 1

                      Hi kglad -

                       

                      I've upgraded the script to AS3. Does that change the way to button would be coded, and how?

                       

                      Thanks!