ActionScript 3 Language Specification |
|||
| ActionScript 3.0 Language Specification > 9 Classes > 9.6 Class methods > 9.6.6 Bound methods | |||
Although a method is not a value by itself, it can be converted to a first class value called a bound method, through extraction. A bound method maintains the binding between a method and its instance. The user-visible type of a bound method is Function.
class A
{
function m() { return this }
}
var a = new A
var mc : Function = a.m // create a bound method from m and a
trace(a==mc()) // trace true, mc remembers its this
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/specs/actionscript/3/as3_specification94.html
Comments
Joe@emeraldforest said on Feb 26, 2008 at 12:09 PM :