3 Replies Latest reply on Mar 21, 2008 4:05 PM by Greg Dove

    External Interface class causes JavaScript error in IE

    tunghoy Level 1
      I'd appreciate any help with this: I need to pass URL info from my pages to my movie. But when I use the External Interface class in AS2, Internet Explorer displays the page OK and runs the movie, but it won't run the JavaScript function that I'm calling and gives me a yellow triangle error of "flash is undefined" in Line 1.

      I've tried publishing to the version 8 and version 9 player. And there is no error in Firefox, which runs my JavaScript and AS code just great. (Yeah, big surprise.) The AS code is fairly simple...
        • 1. Re: External Interface class causes JavaScript error in IE
          Greg Dove Level 4
          You're probably missing a valid id attribute on your OBJECT tag in the html. I did a write up on this problem (although the author's name changed when the forums were upgraded) in the common questions section at Flashgods:

          http://forums.flashgods.org/viewtopic.php?f=20&t=66
          • 2. Re: External Interface class causes JavaScript error in IE
            tunghoy Level 1
            Holy caterpillars Batman, you are a god indeed! Flash was automatically creating the Object and Embed tags when publishing the swf. But I noticed in your article, where you discussed what punctuation marks were acceptable for IDs, forward slashes weren't among them.

            Since the movie is leftmenu.swf and is in the flash subdirectory, the name and ID it got was flash/leftmenu. After mucking about, I found the problem was in the AC_FL_RunContent function (also created automatically when publishing the movie). When I changed the 'id' attribute there to be simply leftmenu, IE and Firefox were both happy, and I didn't have to make any other change. Go figure.

            Thank you!
            • 3. Re: External Interface class causes JavaScript error in IE
              Greg Dove Level 4
              You're welcome. I've answered the same question here a few times and that was the reason I did the quick write-up there.
              There's a whole bunch of useful "common" questions type info there that you might find helpful if you're looking for an answer. And its a growing resource: anyone can contribute, although you need to be registered to do so.
              Sometimes its easier to browse through a list like that first instead of searching. And sometimes its easier to answer the questions in these forums when you can just post a link ;-)