5

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
  • Why the down vote? Am I missing something for this seems like a good question. Commented Jun 24, 2009 at 15:08
  • Yeah, no clue why it got down voted. Seemed a good question to me, too. Commented Jun 24, 2009 at 15:23
  • Just wanted to mention that you don't need to use the complicated (and deprecated) getFlashMovie code in that viget link -- you can simply use document.getElementById. It's supported by all modern browsers including IE6. I use it all the time for ExternalInterface and it works just fine, plus it's forward-compatible and standards-based. Commented Jun 25, 2009 at 5:54

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.