Just another bunch of stuff pouring out of some guy's head

Using the Flash ‘Nested Ojects’ method in ASP pages

Occasionally I want to use Flash on a web page. Tragic, but true. I’ve been looking for an accessible, valid method for doing this. There are few candidates. I settled on the ‘Nested Objects’ method. It seemed quick, painless and didn’t require javascript. But there was a hitch…

Active Server Pages error 'ASP 0139' 
Nested Object 
An object tag cannot be placed inside another object tag.  

IIS’s ASP interpreter wouldn’t pass the page with nested <object> tags.

Of course, nothing is ever simple. I’ve configured IIS to serve .htm and .html files as ASP so every page on my site is an ASP page. This may be an odd thing to do but it seemed easier than renaming every page, ~2000 at that time, and creating appropriate redirects. I also couldn’t easily edit out the snippets of ASP from any given page as the entire site heavily relies on DreamWeaver templates and the ASP is not in editable regions.

I needed a simple solution and this is it… use a server-side include.

Put the non-IE <object>… </object> and IE conditional comments section in the include file.

    <!--[if !IE]> <--> 
      <object data="movie.swf" width="320" height="240" 
        <param name="salign" value="lt" /> 
        <param name="quality" value="high" /> 
        <param name="scale" value="noscale" /> 
        <param name="bgcolor" value="#FFFFFF" /> 
        <param name="pluginurl" 
               value="http://www.macromedia.com/go/getflashplayer" /> 
    <!--> <![endif]--> 

Put the include reference where the displaced code should go.

      <!--#include file="flash.txt"-->

Job done.


Apparently I’m not the first to discover this method.

Thank you! You are a lifesaver!

I, too, found the JuicyStudio solution, but yours was MUCH easier to comprehend.

Thanks again!

Thanks Jaemie, glad it helped.

Indeed, you’re a lifesaver.

Thanks for the solution to add to the bag of tricks.
Here’s another:
You can just replace the first <object , the one before the IE Conditional, with

Take care,

hmmm… it’s not < obviously.

How about

“percent being %


Sorry, board wouldn’t dispaly the code

10X its work fine.

Why did you give an example or sample page?

I didn’t feel the need to give an example as the full code is in the article. I also don’t own any sites that use ASP. I only work on other people’s sites that use ASP and none of them have given their permission for me to link to them.

Hi Sean,

Would it be possible for you to send me a full example of how this works.

I have had it working in Firefox, Opera and Safari but I can’t get IE to render it correctly.

IE displys the the flash file but then won’t parse the rest of my page.


Dave, it’s pretty straightforward. Paste the code section into a separate file and use an include to include the file.

I suggest checking your HTML for properly closed tags or similar.

Hi Sean,

Cracked it, thanks.


any way round the ‘click ok to load content’ bug in ie6?

I found that simply replacing the first '<object' with '<%="' did the job.

Thank you. Thank you. Thank you!

Thank you for posting this solution!

this was incredibly helpful, thanks!

Thanx a ton – never too old to learn!


[…] ?? Server-Side Include ?????????? […]

Leave a comment

Line and paragraph breaks automatic, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


(required, never displayed)

Before you please complete the CAPTCHA below.

Time limit is exhausted. Please reload the CAPTCHA.

Apologies for the CAPTCHA but the SPAM was killing the site. I was getting hundreds each day.