The error only happened in IE8, so I was stuck with IE’s debugger and error messages. The error was being thrown when the loaded SWF attempted to add callbacks to ExternalInterface using ExternalInterface.addCallback As soon as this function was called my script threw an error:
Object doesn’t support this property or method
The stack trace showed an anonymous JScript block with a function named __flash__addCallback which was throwing the error when trying to append a property to a JScript object. The debugger for this particular error looked like this.
I scoured the internet searching for solutions to this problem as I was sure it had to be something that was well documented. I came across some solutions that appeared to work for people such as: ensure your object tag has an id, ensuring you set the type or class id on the object tag. These solutions worked for some people, but didn’t solve the problem I was having.
After a little more investigation I realized that some of my ExternalInterface calls were successful, while others were not. I then realized that play and stop were probably reserved names for IE8 and might be the root of my problem. I adjusted the names of the callback functions to playSong and stopSong and things started working.
This Doesn’t Work:
ExternalInterface.addCallback("play", play); ExternalInterface.addCallback("stop", stop);
ExternalInterface.addCallback("playSong", play); ExternalInterface.addCallback("stopSong", stop);
The moral of the story is to avoid common names when using ExternalInterface. Play and Stop I know are reserved, and I’m sure there’s a host of others out there.