Search code examples
javascriptflashactionscriptexternalinterface

How to list available callbacks exposed by a flash element


Is there a way to query an embedded flash element to determine the available methods that can be executed on it via JavaScript?

Edit: It appears that in IE it's as simple as

for ( i in flashNode ) {
    alert(i);
}

After much clicking, they will be some of the very last members enumerated.

Still not able to determine this in Firefox though.


Solution

  • While it is possible to get the callbacks by enumerating the <object> DOM node in IE, they are mixed in with all the other properties of the DOM node and they are unable to be progamatically distinguished without keeping a list of known properties to compare them against and then taking the difference of the two sets.

    This approach is questionable since properties can be arbitrarily added to any DOM node. Worse, it only works in IE. Firefox (and possibly others) does not return callbacks as a property of the <object> DOM node.