Dang! You beat me to the punch, Mike. I've been working on (more or less) the 
same thing, and 
was just finishing up my documentation and examples last night when you posted 
yours... too bad 
we didn't find out sooner.

Here's my version:
http://jquery.lukelutman.com/plugins/flash/

I've re-written the flash detection and embedding for jQuery (so SWFObject 
isn't necessary), and 
tried to build it to be as flexible as possible in terms of how the 
replacements are done.

Like yours, basic replacements look like:

$('#hello').flash({ src: 'hello.swf', width: 320, height: 240 });

For more complicated stuff (like sIFR or your method of reading data from 
classnames), you can 
pass a custom function, like so (off the top of my head):

$('[EMAIL PROTECTED]"swf"]').flash(null, null, function(htmlOptions){
        $this = $(this);
        htmlOptions.src = $this.attr('href');
        htmlOptions.width = this.className.match(/w\:(\d+/))[1];
        htmlOptions.height = this.className.match(/h\:(\d+/))[1];
        $this.before($.fn.flash.transform(htmlOptions));
});

Or you can change the default:
$.fn.flash.replace = function(htmlOptions) {
        // custom code here ...
};

I'm curious to know what you think :-)

Cheers,
Luke

Mike Alsup wrote:
> I've just posted some convenience plugins for dealing with Quicktime,
> Flash, and mp3 media.
> Source and demos can be found here:  http://malsup.com/jquery/media/
> 
> Mike
> 
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/


-- 
zinc Roe Design
www.zincroe.com
(647) 477-6016

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to