Friday, March 14, 2008

IE 7 + Flash 8 ExternalInterface = BUGTASTIC!

<rant>GRRRRR BROWSER INCOMPATIBILITIES!!!!</rant>

For the past few nights I have been working on and off with a very simple (or what should have been simple) Flash => JavaScript => Flash application. The plan was to use swfobject to embed a flash movie within a form and make the submit button flash. Then after validating the form when the flash button was clicked a sound would play (don't ask - client requested said ability).

So in order to accomplish something like this I created an html form; put the flash div within the form (along with the js call to render); and then used ExternalInstance to trigger the function call on(release) within flash. FireFox worked like the trooper it is. Then comes that dreaded IE 7 test. All aboard the failboat! Every time I get the same stupid error on Line 1: "savebutton" is not defined (savebutton was what I named my flash movie). WTF. I tried everything and traced every variable/function call but nothing. After much Google digging I came upon this article by Steve Kamerman:

He said that IE has a nifty little bug where it can not reference a flash movie properly within a form tag. This was both extremely disheartening as well as a great joy. My flash button was the submit button so I just moved it as well as the flash div that I call in swfobject after the closing form tag and it worked! Thanks Steve for the hint!

Success!

1 comment:

Steve said...

Hi Kevin, you're welcome :)

Steve Kamerman