Modern browsers make it easy to add an SWF banner to your website. In the past, you had to write lengthy HTML code to embed SWFs on Web pages. An SWF file is one that your Flash player plays when you visit a site that uses Flash. Because newer versions of HTML don’t require you to use the outdated "
View Your Web Page’s HTML
Before you put your SWF banner on your live website, you can test it in a local copy of your HTML document that resides on your computer. Testing it locally enables you to customize the HTML quickly without having to upload it to the Web server that hosts your website. Launch your HTML editor or Notepad, and then find the document's opening "" tag and its closing "" tag. These two tags define the document’s body section, and anything you place between those tags appears on your Web page. For instance, if you type "hello" after the opening "" tag, you see that word at the top of your Web page if you view it in a browser.
Add Your SWF Banner
Paste the following in the body section where you want your banner to appear:
Replace "my_swf.swf" with the URL to the SWF you’d like to embed, whether it resides on someone else’s website or your own Web server. After you save your HTML document, launch your browser, and then press “Ctrl-O” to display a window that lists your hard drive’s files. Double-click the HTML document you saved to load it into the browser and see the SWF banner you embedded.
Tweak Your Banner's Dimensions
HTML gives you the ability to make objects larger or smaller. The basic "
Replace 100 with the desired height and 400 with the width you’d like. Those values are in pixels. When you’re done, your code should look like this example:
Add It to Your Website
You can place your SWF banner anywhere you like on your Web page. However, more people may notice it if you put it at the top of the page after the HTML document’s opening "" tag. Don’t make the banner too wide if you don’t want the width to exceed the typical site visitor’s browser width. For instance, if you make the width 1200 pixels, the banner may be too wide for some people to see without scrolling. After you get your banner looking the way you like, you can upload your HTML page to the Web server that hosts your website. To create a new SWF banner, visit a site such as 123-Banner.com or BannerSnacks for help in generating one automatically (see Resources).
- Jupiterimages/Stockbyte/Getty Images