views:

754

answers:

1

Hello,

Wondering if its possible to communication from javascript to flash without the use of SWFobject or any other extra javascript file.

Currently I am using the following guide: http://www.viget.com/inspire/bi-directional-actionscript-javascript-communication

Thank you for your time.

+3  A: 

It's perfectly possible using Flash's externalInterface and the JavaScript you're writing yourself alone (which should be the only JavaScript you'll need).

SWFObject exists only to abstract away adding Flash pieces to HTML content, so it's not necessary at all (it's basically going to write the proper object and embed tags depending on your browser and work around the IEs' ActiveX click-to-run-Flash warnings).

If you wanted to hand-code your Flash piece into a document, that's perfectly fine; SWFObject makes it cleaner and easier but doesn't enable or add functionality beyond that. However, because it works so well, it's become kind of a standard method to get Flash on a site.

Drop your Flash piece on a page however you'd like, make sure it has an id set in its object and embed tags and you should be set.

ajm