How to Embed an SWF With SWFObject 2

SWFObject2 is a JavaScript program you use to embed Flash SWF files into Web pages. You can also use it to embed Flash movies into a Web page when you don't have access to the Adobe Flash Professional software. The SWFObject2 program download comes complete with a SWFObject generator. This object generator, once given the name of your SWF file, will automatically generate a Web page complete with the necessary JavaScript code needed to link your Web page to the Adobe Flash player plug-in and to your SWF file.

Instructions

    • 1

      Navigate to the Google Code SWFObject Downloads page (see Resources). Click on the "swfobject_generator_1_2_html.zip" link to download the SWFObject HTML generator zip file to your computer system.

    • 2

      Navigate to the directory that you saved "swfobject_generator_1_2_html.zip" to on your computer and click the file entitled "Index" to display the SWFObject 2 HTML and JavaScript generator v1.2 dialog box.

    • 3

      Type in the name of the SWF file that you want to embed into an HTML page in the "Flash (.swf)" text box in the object generator dialog box. Click the "Generate" button to generate the HTML page for the SWF file.

    • 4

      Click and drag with your mouse to highlight the text in the "Generated output" text box. Right-click and select "Copy" to place the code on your computer's clipboard.

    • 5

      Open up a text editor. Click "File" and select "Paste" to place the HTML code into the text editor. Alternatively, click to place your cursor on the page, right-click and select "Paste" from the drop-down menu.

    • 6

      Click "File" and select "Save As." Save the file as an HTML file. Add the extension ".html" to the file name to ensure that the file will be an HTML file.

    • 7

      Navigate to the file directory on your computer or Web server where you saved the HTML file. Click on the HTML file. Observe that this embeds the Flash animation or movie in your SWF file and it will play inside your Web page.

Learnify Hub © www.0685.com All Rights Reserved