這裏有一個非常簡單的代碼,它解釋了在使用調用函數方法時,我在AS2和AS3之間發現的差異。Function.call(thisObject)不適用於AS3
var a = {name:"a"}
var b = {name:"b"}
function c()
{
trace(this.name)
}
c() // AS2: undefined AS3: root1
c.apply(a) // AS2: a AS3: root1
c.apply(b) // AS2: b AS3: root1
如何強制AS3尊重AS3中的thisObject參數?
這是Adobe文檔 「http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Function.html#apply()」
感謝
[這](HTTP://計算器。 com/questions/7238962/function-apply-not-using-thisarg-parameter/7260369#7260369)也可能有所幫助。 –