Flickr, and implementing __resolve

It's quite unusual to find any use of __resolve in real Flash movies. That's why it hasn't been supported in Gnash up to now. But after investigating why Gnash didn't play the Flickr widget, it turned out the widget relies on __resolve to implement certain functions of the Flickr API.

An object's __resolve property in ActionScript comes into play when an undefined member is invoked. The following code will of course trace 'undefined':

o = new Object();

However, if you add:

o.__resolve = function(str) {
    return "resolve called: " + str;
trace (o.a);

the trace is "resolve called: a". The __resolve function is called with the name of the undefined member as a string argument. Flickr uses the __resolve functions to handle certain functions to send to the server as part of an XML.sendAndLoad() call.

Now Gnash implements this, the Flickr flash photo widget works.