views:

369

answers:

3

I'm alreadu using jquery library on site.

What are pros and cons to use jQuery SWFObject plugin over origional swfobject

jQuery SWFObject plugin

http://jquery.thewikies.com/swfobject/

+3  A: 

It just removes cross-browser issues out of the mix, it's an abstraction layer. Sometimes declaring the variables right on flash movies are slightly different amongst browsers...better to remove this from the equation, just like you'd use jQuery's .height() instead of figuring out what each browser does yourself.

Do it once, trust that it works, you don't need to load up every browser to test to see that all the variables are right each time (though I'm not saying that's a bad idea).

Nick Craver
you means no cons to use jquery plugin
metal-gear-solid
@jitendra - Only if you weren't using jQuery before, if you already have it in the site, then no...at least I've never come across any.
Nick Craver
A: 

The biggest benefit of using the jQuery plugin vs the original SwfObject library are that you are only dealing with one javascript library. All the syntax is jQuery syntax and that's really fun.

Additionally, when you use the jQuery plugin is that when you create the swf, you get a the swf back as a jQuery object which you can further manipulate like so...

var swf = $('#putFlashHere').flash({
              swf: 'myFlash.swf',
              height: 400,
              width: 600
          });

swf.css({ 
  "margin" : "10em", 
  "border" : "solid 4px red"
});
jessegavin
+1  A: 

The jQuery SWFObject plugin is a port of SWFObject 2.2, so it should offer the same functionality. In general:

jQuery plugin == more convenient if you already use jQuery. Probably works as well as regular SWFObject since it incorporates the original codebase.

Standalone SWFObject == more thoroughly tested and has wider user base.

pipwerks