日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

ActionScript 3 作用域内部细节介绍

發布時間:2025/3/15 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ActionScript 3 作用域内部细节介绍 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

ActionScript 3 的作用域使用對象鏈表來記錄在作用域中的定義(變量、函數、類、接口和命名空間)。

● Class scope: the class's Class object (and the Class objects of the class's ancestors)

●?Static method scope: the class's Class object (and the Class objects of the class's ancestors)

●?Instance method scope: the current object (i.e., this) and an activation object (an "activation object" is an object created and stored internally by ActionScript for the purpose of maintaining the local variables and parameters of function or method)

●?Function scope: an activation object

如下樣例代碼:

1 package { 2 public class SomeClass { 3 public function instanceMeth():void { 4 function nestedFunc():void { 5 trace(a); 6 } 7 } 8 } 9 } 10 var a:int = 15;

?

它的搜索過程為:

1、newstedFunc() 的 activation object

2、調用 instanceMeth() 的對象

3、SomeClass 的類對象

4、Object 的類對象(在搜索全局對象之前,它會先搜索 SomeClass 的父類,也就是 Object 的類)

5、全局對象

轉載于:https://www.cnblogs.com/ezine/archive/2012/06/10/2544070.html

總結

以上是生活随笔為你收集整理的ActionScript 3 作用域内部细节介绍的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。