ActionsScript 3: Calling nonexisting methods

I have been wondering all along how it is possible to call a method that is not defined anywhere in that class and get something reasonable done, e.g. the method on the Cairngorm delegate that conducts the call to the server.

After playing around with Grails I became aware of the fact that this mechanism is used extensively not only in Grails but in other frameworks that are based on dynamic languages such as Ruby on Rails.

This great blog entry on lifts the veil and explains the magic.