views:

144

answers:

1

The code I want to have saved through TinyMCE is as follows:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550" height="90" id="homepage-banner">
    <param name="movie" value="/images/header.swf" />
    <param name="wmode" value="transparent" />
    <!--[if !IE]>-->
        <object type="application/x-shockwave-flash" data="/images/header.swf" width="550" height="90">
            <param name="wmode" value="transparent" />
    <!--<![endif]-->
            <img src="/images/header.jpg" width="550" height="90" alt="" border="0" />
    <!--[if !IE]>-->
        </object>
    <!--<![endif]-->
</object>

Sadly, what I end up with is:

<object data="/images/header.swf" height="90" type="application/x-shockwave-flash" width="550">
    <param name="id" value="homepage-banner" />
    <param name="wmode" value="transparent" />                
    <param name="src" value="/images/header.swf" />               
</object>

The purpose of the stripped parts of the code is to provide a fallback image if flash is not available on the client.

In my tinyMCE.init({ ... }); I am using verify_html: true and valid_elements is set as per this forum topic whereby all valid XHTML 1.0 Strict elements are allowed. I have checked and the above code does comply with the XHTML 1.0 Strict standard.

I have tried just setting verify_html to false but it had no effect. How can TinyMCE be configured to leave my HTML alone?!

A: 

Solved it by using SWF Object from google code.

I now paste the following code into TinyMCE:

<div id="header-image">
    <img border="0" src="/images/header.jpg" width="550" height="90"/>
    <script type="text/javascript">swfobject.embedSWF("/images/header.swf", "header-image", "550", "90", "9.0.0");</script>
</div>

With the following code in the <head>:

<script type="text/javascript" src="/js/swfobject2.js"></script>
Matt