19 Replies Latest reply on Nov 26, 2013 11:42 AM by Netcommercial

    Embed Flash in HTML [moved from AS3 forum]

    Netcommercial Level 1

      Hi All,

      Thanks for looking in. I have a WP site and they have decided to remove the capability of using Flash files. Stated for security reasons? So I figure I could just park a folder on my server, with the SWF and the SWZ files tha Flash Pro generates when publishing into that folder on my server.

       

      My question is the code to embed into the HTML page instructing the Browser to fetch a Flash Player and or open the flash player so that the flash file embeded in my HTML page will be previewed to the user. What code do I use? I found some stuff on the net from 2008. If someone would paste code in here that I could copy and paste and switch out the specific path to the SWF and SWZ file it would be appreciated.

       

      One other thing, I undertsand that it is the Brower that has a Flash Player in it No? Is that correct?

       

      Or must I load a Flash Player into that folder I am to upload with the SWF and SWZ file Flash Pro generates?

       

      I am not sure if this is a Dreamweaver question, as it teeters between Flash code and HTML....Plus I am using a WP site for this one.

      Thanks in advance for the code.

      Best,

      NC

        • 1. Re: Embed Flash in HTML
          Ned Murphy Adobe Community Professional & MVP

          The Flash Player is installed at the user end for their browser(s).  You can't do anything to force that into their machines.

           

          If you want embedding code for placing Flash content in an html page you should look into using swfobject:

           

          http://code.google.com/p/swfobject/

          • 2. Re: Embed Flash in HTML
            .:}x-=V!P=-x{:. Level 3

            You could just publish it with HTML checked in publish setings and open the outputted HTML file in editer and copy the embed code and change the relative file source paths to the SWF to absolute path to where you upoaded it and paste the code in your sites container for it.

            1 person found this helpful
            • 3. Re: Embed Flash in HTML
              Netcommercial Level 1

              V!p

              So when I hit publish of my stage, (I do have "with html 'ticked')  where is the outputted HTML code to copy and paste?  I am getting a SWZ file published next to my SWF but Win7 does not know how to open it. Is there another place to preview the code and paste into notepad?  Thanks.

               

               

              @Ned Thanks. The Browser only gets the Flash player and does not have it on board. The link is for SWF 101, I was really looking for the code to cut and paste and switch out the Specific addresses.

              • 4. Re: Embed Flash in HTML
                Ned Murphy Adobe Community Professional & MVP

                I don't know what you were trying to say with your reply but the browser does not get the Flash player... it is up to the user to do that - to have the browser installed for their browser.  The browser can prompt the user if your embedding code provides that option, but it cannot install the Flash player automatically.  No one can install programs like that on someone else's machine - it is up to the user to do that.  Otherwise, it would be called a virus.

                 

                The link I gave has nothing to do with whatever you are calling SWF 101.  It is a link to code for embedding Flash content in an html page, much like what Flash will publish. 

                 

                If you need to find the file on your machine that Flash published it should be in the directory with your swf by default, but if not, the path to it on your machine should be specified in the interface where you selected the html option for publishing.

                • 5. Re: Embed Flash in HTML
                  .:}x-=V!P=-x{:. Level 3

                  It should default to your SWF location.

                   

                  In publish settings when you select HTML in left column the output location should appear to right. You can change it if needed.

                  • 6. Re: Embed Flash in HTML
                    Netcommercial Level 1

                    @Ned

                    My statement was that of aknowledgment. That the Browser does not have a player on board to play a SWF that it may come across. As you have stated, it only is instructed there is a file and to go get one and the end used decides to install.

                     

                    The link you sent me, I am reading. There is a lot of code, so I am now starting from the beginning to find which one I need. It would be appreciated if instead, you were to cut and paste the proper code over here . (see below)

                    Then provide the link for me to delve further into it if so desired. Maybe even underline or BOLD the parts to switch out for specific paths. Since over there reading, there are inner and outer players or whatever they are.

                    Just wanting to publish a Flash file and not learn Drupal, JS, etc. LOL

                    As stated, I am over there now and it is not as evident for someone who does not know what the code means and only cares that it works, (Via switch out specific path to files) Which is a bit daunting in itself for those who are not familiar with it.

                     

                     

                    @V!P I will try and see if I can note the output location of the HTML Code. What kind of file is it? Do you know the extension it would be?

                     

                     

                    Apparently there is no 'canned code' to paste into an HTML page prompting a Browser that there is a Flash file embedded and to play it by going here www.example, and if you need a player, it is here www.example2. If the end user desires.

                     

                    From reading over at the link Ned sent  I need to upload a player as first stated and then encourage the user to go to Adobe for a richer experience. Yet I am still trying to find the code. I appreciate your help.

                     

                    Was  this the code Ned? And which parts do I switch out? Thanks again. FWIW- there are 10 bodies of code on that link!

                     

                    This code looks like what is at the top of an HTML page which paths need to be switched? Maybe BOLD them please which is the player and which is the SWF & SWZ. I see the "mycontent.swf" is that where I am to switch out to "http://www.mysite.com/flashfolder/flashfileinquestion.swf" What is up the the w3.org links?

                     

                    <!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">
                     
                    <head>
                       
                    <title>SWFObject - step 1</title>
                       
                    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
                     
                    </head>
                     
                    <body>
                       
                    <div>

                         
                    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">
                           
                    <param name="movie" value="myContent.swf" />
                           
                    <!--[if !IE]>-->
                           
                    <object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420">
                           
                    <!--<![endif]-->
                             
                    <p>Alternative content</p>
                           
                    <!--[if !IE]>-->
                           
                    </object>
                           
                    <!--<![endif]-->
                         
                    </object>

                       
                    </div>
                     
                    </body>
                    </html>

                    • 7. Re: Embed Flash in HTML
                      Netcommercial Level 1

                      Here is my publish settings opened...

                      flash.GIF

                      • 8. Re: Embed Flash in HTML
                        .:}x-=V!P=-x{:. Level 3

                        in addition to checking the check box  - you have to select/highlight the "html wrapper" to see its output location, you have "flash (swf)" highlighted in the image.

                        • 9. Re: Embed Flash in HTML
                          Netcommercial Level 1

                          V!p,

                          That is what I have been looking for... Now I just need to open the HTML page in an editor to grab the code needed and to then update my paths from local to remote server. THANKS!

                           

                          While I got you here, I was wondering about a couple things such as "ALT" images if someone is not allowing scripts in their browser. DO I Just click the desired format as in the pic to get a copy of those to upload? IF so are there any other simple suggestions (like you did with hi-light HTML to get published code) as you've  shared to get the proper code, etc as above? Thanks again.

                          flash2.GIF

                           

                          One couple things maybe you know??

                           

                          This HTML generated, which paths do I need to switch out? I have a bit of a challenge here. I am using WP site as mentioned in the post, but Wp does not allow SWF so that is why I have been trying to learn where the HTML code is to then park my SWF file on the same server but not within WP. Yet the HTML code (See below) references "same site" for where to find the swf file. Do you know which paths need to be updated with the server path? Also I do not need the XHTML Right? I need only the <body> All in between </body>

                           

                          <!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">

                              <head>

                                  <title>holiday advertising</title>

                                  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                                  <style type="text/css" media="screen">

                                  html, body { height:100%; background-color: #ffffff;}

                                  body { margin:0; padding:0; overflow:hidden; }

                                  #flashContent { width:100%; height:100%; }

                                  </style>

                              </head>

                            

                           

                          <body>

                                  <div id="flashContent">

                                      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="360" id="holiday advertising" align="middle">

                                          <param name="movie" value="holiday advertising.swf" /> <-- is this OK like this or does it need a specific path?

                                          <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" /> <--- IS This the specific path? in "  "

                                          <!--[if !IE]>-->

                                          <object type="application/x-shockwave-flash" data="holiday advertising.swf" width="640" height="360"> Again here also? "  "

                                              <param name="movie" value="holiday advertising.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" />      <-- Is Value=" My specific path/folder/file

                                          <!--<![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>

                              </body>

                           

                           

                          </html>

                          • 10. Re: Embed Flash in HTML
                            .:}x-=V!P=-x{:. Level 3

                            The alt images can be exported but they will not be auto linked to the HTML page. You will have to manually add the image tag to the HTML.  You would put the alt image tag where the "Get Adobe Flash Player" image is. You can replace the image source path to the "get flash" image to your image path if you want your image clickable to get flash or you can just make a new image tag and put it above or below the get flash image to retain the get flash" button image.

                             

                            swf file paths need to be changed in the three spots that define "holiday advertising.swf"

                            if the swf is uploaded to the same directory as the wp page that is viewing it then the relative path should work.

                            if you uploaded the swf to a different directory then the wp page then you need to define the path to it.

                            parent directory = "../file.swf"

                            same directory = "file.swf"

                            child directory = "directory/file.swf"

                             

                            for the embed code you only need to copy the div and containing code <div id="flashContent"> ........ </div>

                            • 11. Re: Embed Flash in HTML
                              Netcommercial Level 1

                              V!P,

                               

                              <h1 THANK YOU /h1>

                              Appreciate you taking the time to read and answer all the questions. 

                               

                              So those Alt pics are 'place holders' for something there, on those who may have script blocked & then when clicked they launch the browser to go get Flash player?

                              What would be the correct term to search for the HTML code to have that? 

                              Best,

                              NC

                              • 12. Re: Embed Flash in HTML
                                .:}x-=V!P=-x{:. Level 3

                                Yes the image would be shown only if the flash player is not insalled or activated.

                                 

                                The code is in place aready in your exported HTML file. it has a default "Get Flash" image linked to the download page for flash player. You can replace that images' src path to your own if you know the path to it. heres what to look for in the HTML code

                                 

                                <a href="http://www.adobe.com/go/getflash">

                                                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.g if" alt="Get Adobe Flash player" />

                                                    </a>

                                 

                                 

                                Here are a couple terms I know of but not complete:

                                Flash fallback
                                Flash alt content

                                • 13. Re: Embed Flash in HTML
                                  Netcommercial Level 1

                                  Very Cool V!P thanks. I am not getting any Joy from my Server and changing the 3 links as forementioned... Must I create an HTML page at the same time as I do my SWF file? Are they specifically embeded with a unique identifier?

                                  I'm also gettin this

                                  WARNING

                                  Your Content will not stream. Runtime Shared Library (RSL) preloading will require all your content to download before the first frame will play.

                                  To prevent this you can change the Runtime Shared Library Library Settings in the Advanced ActionScript 3.0 Settings dialog which can be raised from the Publish Settings dialog.

                                   

                                  I went over to the Wrench Icon for advanced settings and change the drop dn>

                                   

                                  The Wrench Icon has options.

                                  These options are>

                                  Source Path/Library Path/Config constants/

                                   

                                    Switched it from (RSL) to my other option (merge into code)  and exported it without the errror. Do you think that is my challenge for not seeing my flash video embeded into my WP HTML page?

                                  • 14. Re: Embed Flash in HTML
                                    .:}x-=V!P=-x{:. Level 3

                                    Once you have created the HTML file you won't need to keep exporting one even if your making changes to the SWF.

                                    The only unique identifier is the object classId that specifies the version of flash player it was exported for.

                                     

                                    The warning you got I am not familiar with. But if you followed its recommendation and do not get the error again I'd say you won that battle!

                                     

                                    If your SWF file size is large then you might see a delay in seeing it live especially if you did not program a preloader to display while it is loading the main content.

                                    • 15. Re: Embed Flash in HTML
                                      Netcommercial Level 1

                                      V!p,

                                      Thanks for the reply. I got it go.. Thanks.

                                       

                                      Funny thing, if you refer to the original code I posted, you will see no shockwave player. I grabbed one from one of my other pages, a  http macromedia shock wave player.. seems to be missing on these latest exported HTML pages? I do not know why?

                                       

                                      Weird that I can open the HTML page local and see my file using that same code, then exchanging the "holiday advertising.swf" to a specific path the SWF file is parked at. Gives me nothing when installing it in my website.  I had to as stated, grab a macromedia shockwave player and install it in the HTML page.. Am I not hi lighting somewhere? And why will it play local using the code above? Yet, installing remote (on my server) I needed the macromedia shockwave player?

                                       

                                      Yes, I have flash player installed... I targeted my SWF for 9.0 (figrued to roll it back a couple versions) And the shockwave player is older then that....

                                      • 16. Re: Embed Flash in HTML
                                        .:}x-=V!P=-x{:. Level 3

                                        Flash does not install the player when you export it to HTML. It just writes the code to activate the installed player on the users machine. If the user does not have the correct or latest player version then they get directed to download the latest player. Also someimes it only installs into one browser and you have to do it again for a different browser program like IE or Firefox.

                                         

                                        Im glad you got it working!

                                        • 17. Re: Embed Flash in HTML
                                          Netcommercial Level 1

                                          Hello V!p,

                                          I know that it does NOT install a flash player, I realize the end use installs it or has it installed already. I get that for sure. However if you look at the code you will see that it does not include the flash player to use?

                                          In other words, when I exported the HTML from Flash using the HTML Wrapper hi-lit and hit Publish. Locally I can click on my HTML page (FireFox in my case) and Voila' it opens. When taking that same code cut and paste into my websites page (Wordpress in my case) Then uploading the SWF file into my media folder and grabbing the specific address, changing the 4 points it references as you shared with me. I do not get a working file.

                                          I do get Adobe's gif icon, I even tried downloading a new flash player (Which by the way is all on the same computer this is happening) Still nada'

                                           

                                          Not until I ripped out a macromedia flash "what appears to be a player or a path to a player" (After the end user OK's it) do I get a working file. I will Send it to you PM if you care to take a look and enlighten me on what I am seeing there? Just send me a PM stating you do not mind me sending you the info, so you can see the working HTML and let me know what the difference is between the HTML Wrapper and this other code I stuffed in there. I am not a coder or webby, I am a starving motion graphic artist who hacks away at his own site. LOL  "Even a blind squirrel finds a nut once in while...."

                                          • 18. Re: Embed Flash in HTML
                                            .:}x-=V!P=-x{:. Level 3

                                            I dont know how to PM you, I think that feature is deprecated. All I need to see is the link to the live one not working.

                                            • 19. Re: Embed Flash in HTML
                                              Netcommercial Level 1

                                              Check your inbox here..