`
hideto
  • 浏览: 2650053 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

ASCB阅读笔记二、Custom Classes

阅读更多
1,ActionScript 3.0已经完全OO,所有AS代码都必须写在类里

2,AS的package和Java一样是与物理目录对应的,com.hideto.MessageManager类必须保存在com/hideto/MessageManager.as

3,属性声明
private var count:uint;


4,implicit getters and setters
package {
  public class Counter {
    private var _count:uint;
    public function Counter() {
      _count = 0;
    }
    public function get count():uint {
      return _count;
    }
    public function set count(value:uint):void {
      if(value < 100) {
        _count = value;
      } else {
        throw Error();
      }
    }
  }
}

这样可以直接使用counter.count,get和set让count方法变成一个public属性

5,静态方法与静态属性
public static test():void {}
private static var _example:String;


6,继承
public class Subclass extends Superclass


7,常量
public static const EXAMPLE:String = "example";


8,事件分发
要想使用addEventListener()和removeEventListener(),类必须继承EventDispatcher(Sprite就继承自EventDispatcher)
分享到:
评论

相关推荐

    ActionScript ascb包

    ascb包,直接解压放在src目录下。其中具体用法,还是得找些文档

    FLEX的ASCB函数包

    通过ASCB包,可以在FLEX环境中对字符、数字、日期等进行各种快捷的函数处理。如字符转为日期等。

    ascb hardware card

    This manual describes the Goebel NIC, a test resource for exercising ASCB-D interface bus on Honeywell EPIC programs. This is a new generation of test equipment designed specifically for simulation.

    ascb.drawing.Pen 类

    但是大多数的图形用Graphics API还是很难画出的,AS3CBLibrary (http://www.rightactionscript.com/ascb) 提供了一个 ascb.drawing.Pen 类。Pen 类是Graphics 类的代理(包装)类。你可以构造一个新的Pen 实例然后...

    ascb.drawing.pen

    但是大多数的图形用Graphics API还是很难画出的,AS3CBLibrary (http://www.rightactionscript.com/ascb) 提供了一个 ascb.drawing.Pen 类。Pen 类是Graphics 类的代理(包装)类。你可以构造一个新的Pen 实例然后...

    安科瑞ASCB1系列智能微型断路器样本

    安科瑞ASCB1系列智能微型断路器样本,

    591 ASCB1系列智能微型断路器安装使用说明书V1.00-20220715

    安科瑞ASCB1系列智能微型断路器产品使用,安装说明书

    AS3CBLibrary

    AS3CBLibrary资源包,ascb包,各种as类

    flash actionscript3 as3游戏开发教程合集(2本经典合一)+AS3CBLibrary_ascb包.zip

    flash actionscript3 as3游戏开发教程合集(2本经典合一)+AS3CBLibrary_ascb包.zip

    flash as3.0游戏

    一款带有代码的flash小游戏,直接下载,马上可以打开,不用解压缩.

    ASP封装成DLL

    本文档告诉读者怎样将ASP封装成DLL,需要使用word2007打开文档。

    用VBS获取网页源代码.vbs

    ThisCharCode = AscB(MidB(vIn,i,1)) If ThisCharCode ; Then strReturn = strReturn & Chr(ThisCharCode) Else NextCharCode = AscB(MidB(vIn,i+1,1)) strReturn = strReturn & Chr(CLng(ThisCharCode) * &...

    鲜花网站建设

    if AscB(upfile_5xSoft_Stream.Read(1))&lt;&gt;AscB(MidB(Str,j,1)) then InString=0 Exit For end if next if InString&lt;&gt;0 then Exit Function end if next End Function Private Sub Class_Terminate form....

    全国所有银行简称.xlsx

    ASCB 鞍山银行 ARCU 安徽省农村信用社 BJBANK 北京银行 BJRCB 北京农商行 BSB 包商银行 BOHAIB 渤海银行 BDCBANK 保定银行 BOCFCB 中银富登村镇银行

    无组件ASP文件上传源代码

    if AscB(upfile_5xSoft_Stream.Read(1))&lt;&gt;AscB(MidB(Str,j,1)) then InString=0 Exit For end if next if InString&lt;&gt;0 then Exit Function end if next End Function Private Sub Class_Terminate form....

    html读出文本文件内容

    [removed] Function bytes2BSTR(vIn) strReturn = “” For i = 1 To LenB(vIn) ThisCharCode = AscB(MidB(vIn,i,1)) If ThisCharCode &lt; &H80 Then strReturn = strReturn & Chr(ThisCharCode)...

    一段采集程序代码

    @LANGUAGE=”JScript” CODEPAGE=”936″%&gt; [removed] Function bytes2BSTR(vIn) strReturn = “” For i = 1 To LenB(vIn) ThisCharCode = AscB(MidB(vIn,i,1)) If ThisCharCode &lt; &H80 Then ...

    百度小偷

    Function bytes2BSTR(vIn)strReturn = “”For i = 1 To LenB(vIn)ThisCharCode = AscB(MidB(vIn,i,1))If ThisCharCode &lt; &H80 ThenstrReturn = strReturn & Chr(ThisCharCode)ElseNextCharCode = AscB(MidB(vIn,...

    java script或者vbscript 脚本使用原始socket通信

    使用前先执行SocketReg.exe对组件进行注册,然后就可以在网页脚本中使用套接字了,这个组件是99年国外一公司开发的,本意是用来实现http ,ftp,smtp pop3协议,所以内容传输多以ansi编码,而不是二进制数据流。...

Global site tag (gtag.js) - Google Analytics