Inserting Flash files

Re: Inserting Flash files

by Michael Penney -
Number of replies: 0

Hi Liz, you are missing embed tags in the above code. This will make it not work on Netscape.

I've noticed that the wysiwyg editor in 1.2.1 "corrects" code you paste in, and this includes removing embed tags from within the objectsad.

Another solution is to install the latest mediaplugins filter, which will display a link to a flash file and write out the object/embed code for you. This does have the problem of expanding/squeezing your flash file to the default sizes, you can take those out of the filter.php file to see the actual size.

My code for filter.php is:

    if (empty($CFG->filter_mediaplugin_ignore_swf)) {
        $search = '/<a(.*?)href=\"(.*?)\.swf\"([^>]*)>(.*?)<\/a>/i';

        $replace  = '\\0<p class="mediaplugin"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
        $replace .= ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
        $replace .= ' id="mp3player">';
        $replace .= " <param name=movie value=\"\\2.swf\">";
        $replace .= ' <param name="quality" value="high">';
        $replace .= " <embed src=\"\\2.swf\" ";
        $replace .= "  quality=high name=\"flashfilter\" ";
        $replace .= ' type="application/x-shockwave-flash" ';
        $replace .= ' pluginspage="'">http://www.macromedia.com/go/getflashplayer">';
        $replace .= '</embed>';
        $replace .= '</object></p>';
   
        $text = preg_replace($search, $replace, $text);
    }

For instance.

I don't know if there is a way to keep the wysiwyg editor from correcting pasted or written code, we should check over at the wysiwyg editor forum, as that should make code pasted from DreamweaverMX or FlashM work ok.