搜尋部落格文章

2012年6月15日 星期五

ActionScript 命名規則定義

基本上變數常數都是私有的(private),如需被外部採用,則透過public function get方式開放

變數

  • private var _variable
  • public var variable public  function get variable
  • private static var _variable
  • public static var _variable  public function get variable
常數
  • private const _VARIABLE
  • public const VARIABLE  public function get VARIABLE
  • private static  _VARIABLE
  • public const VARIABLE  public static function get VARIABLE
取用方式
  • 全域變數 this._variable (特徵:this+變數名稱)
  • 全域靜態 Class._variable  (特徵:類別名稱+變數名)
  • 區域變數 variable (特徵:無底線,沒有參照this)

沒有留言:

張貼留言