Swf not working in Aspx page

Many of you might have come to a problem of Swf not working in Aspx page. You might have tried to embed flash object in the ASP.NET page but it doesn’t work even after modifying parameters. The same thing might be working in the simple HTML page but not in the ASP.NET.

Why?

Because most of the examples on internet shows the example as:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="400" id="banner">
    <param name="movie" value="images/FileName.swf" />
    <param name="quality" value="high" />
    <embed src="images/FileName.swf" width="800" height="400" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
  </object>

It works in the simple HTML page, you run it, it works fine but when you put it in the ASPX page and try to run using the website URL, it doesn’t work

Actually the problem resides in the file path because you have to provide the relative path which can be accessed using the website URL.

So you can fix it by modifying the above code as mentioned below:

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

Enjoy!!!