How to Make Flash (.swf) Transparent?

There are two ways to make flash file transparent, one is to export as a transparent file when you are publishing from Macromedia Flash and another to insert a line of code in the HTML. We will cover both ways in this tutorial.

Browsers that support flash transparency:

  • Internet Explorer 3 or higher (Windows)
  • Internet Explorer 5.1* and 5.2* (Macintosh)
  • Netscape 7.0*
  • Mozilla 1.0 or higher*
  • AOL*
  • CompuServe*

* Macromedia Flash Player version 6,0,65,0 (Windows) or 6,0,67,0 (Macintosh) or higher required for this feature.

1. First let's look at the first one, publishing flash file (.swf) as a transparent file. Open a new file in your Macromedia Flash and draw circle in the middle with any color. Now save your file and go to File > Publish Settings or press Ctrl+Shift+F12. You should see the following window. In this window go to HTML tab and select Transparent Windowless from Window Mode. And press Publish.

image 1

Now your file is saved as a transparent swf. To be able to check the transparency of your file go and change the background color of your page (which was generated by Flash) from white to some other color. If you have followed correctly you should see only your circle on your background color, without the white rectangle around it.

2. Let's see the second way of making flash transparent. Rarely you will use the Flash generated page in your homepages, most of the time you will be inserting a flash file into your existing page. This second way of making flash file transparent is suitable for the latter.

Open your page that you would like to insert flash file with Dreamweaver or with any other HTML Editor and insert a flash file inside it. Click on the flash file and go to the code view mode.

You would see a code similar to the following:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="100">
<param name="movie" value="images/trans.swf">
<param name="quality" value="high">
<embed src="images/trans.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="200" height="100"></embed>
</object>

What you have to do now is to insert a line of code inside this code, telling that this flash should be transparent. Here is the revised code. New code is shown in bold.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="100">
<param name="movie" value="images/trans.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="images/trans.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.
com/go/getflashplayer" type="application/x-shockwave-flash" width="200" height="100"></embed>
</object>

Just insert this line of code in green color after the last <param name="... code and add to wmode="transparent" the <embed src="... And you should have a transparent flash file!


Close    To Top
  • Prev Article-Flash:
  • Next Article-Flash:
  • Now: Tutorial for Web and Software Design > Flash > Action Script > Flash Content
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Geek Tutorial
     

    Blogging Tutorial

      RSS Tutorial
      Podcasting Tutorial
    Graphic Design Tutorial
      Coreldraw Tutorial
      Illustrator Tutorial
      3D Tutorials
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial/ Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial/ Articles
     

    XML Style

      AJAX Tutorial
      XML Mobile
    Flash Tutorial/ Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial/ Articles
      Linux Tutorial
      Symbian Tutorial
      MacOS Tutorial
    Personal Tech
      Hardware Tutorial
      Software Tutorial
      Online Auction