日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

學(xué)習(xí)AS3:唯一的類變量_Flash教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:學(xué)習(xí)AS3:*新的變量類型
AS3中有許多新的數(shù)據(jù)類型。其中有些類型是以前沒有出現(xiàn)的。AS3中的基本數(shù)據(jù)類型如下:簡單數(shù)據(jù)類型:BooleanintnullNumberStringuintundefined

(本文非直接翻譯,原文如下:)
In ActionScript 2, variables defined within a class's body were defined in the class's prototype object. This was an efficient means to handle variable definitions but it also meant that complex data types (such as Arrays) had a tendency to be "shared" among instances if not explicitly defined for instances within the class constructor. This is no longer a problem with ActionScript 3. Class variables defined in the class body are now unique to each class instance so this problem no longer occurs.

在AS2中,復(fù)雜數(shù)據(jù)類型(比如數(shù)組),假如在類體之中,方法之外直接初始化,而不在構(gòu)造器中初始化,會(huì)被理解為“共享”的數(shù)據(jù),而被所有的實(shí)例共享使用(類似于static的效果)。但是在AS3中不存在這個(gè)問題。類變量是每個(gè)實(shí)例獨(dú)有的,唯一的變量。如下:

class myClass{

private var list:Array = [1,2,3]; //在AS2中會(huì)有一定問題,AS3中就很好

public function myClass(){
//在AS2中,應(yīng)該在這里初始化list
}
}

分享:學(xué)習(xí)做FLASH留言本:分頁技術(shù)
這次是做留言板分頁ASASPACCESS,傳遞一個(gè)id,一個(gè)標(biāo)題title,作者author三種數(shù)據(jù),那么就定義一個(gè)allId,AllTitle,allAuthor,然后循環(huán)讀取數(shù)據(jù)庫把所有數(shù)據(jù)

/所屬分類:Flash教程/更新時(shí)間:2008-03-05
相關(guān)Flash教程