3.1 注释
- 行注释:
//行注释内容
- 块注释:
/*
块注释内容
*/
3.2 变量
ActionScript(AS),遵循ECMAScript标准
AS中的原始变量
- Boolean
- int
- unit
- Number
- String
关于int和Number的执行效率: 我们可能会认为大部分时候使用int比使用Number的效率要高,但是由于Flash是面向绘制技术的运行时环境,在处理int类型的数据的时候会将int转换为Number,因此Number的执行效率比int高。但在for循环的使用中还是要常用int类型作为循环变量。
核心类中的复合类型
- Object (所有类的父类)
- Array
- Date
- Error
- Function
- RegExp
- XML
- XMLList
特殊类型
- * (一个可选的方法,在运行时再告诉编译器其类型)
- void
- undefined (表示void, 区别是void返回空,undefined判断返回值是void)
- null (判断复合对象或String类型没有赋值)
- NaN (Not a Number的缩写)
3.3 循环语句
一般for循环
for(... in ... )循环
for each循环
while循环
do while循环
3.4 分支语句
if
if...else
switch
3.5 Array
- push()
- unshift()
- pop()
- shift()
- splice()
splice(param1, param2, parma3)
param1: 欲操作的数组下标位置
param2: 欲删除的数组元素个数,0表示不删除
param3: 欲插入的元素。从param1位置插入。
关联数组( {key: value})
for (var key:String in carManufacturersByModel)
{
trace("Key:"+key); //输出key
trace("Value:"+carManufacturersByModel[key]); //输出value
}
分享到:
相关推荐
FriendsofED.The.Essential.Guide.to.Flex.2.with.ActionScript.3.0.Feb.2007.pdf Flex ,flash的优秀的学习书籍。希望能对你们有帮助。
ActionScript Flex.3.Language.Reference.cnActionScript Flex.3.Language.Reference.cnActionScript Flex.3.Language.Reference.cn
Adobe.Press.Advanced.ActionScript.3.with.Design.Patterns.Nov.2006.chm CHM版
Game.Development.with.ActionScript
New.Riders.Publishing.Object.Oriented.Programming.with.ActionScript.2.0
About ActionScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Using ActionScript in Flex applications. . . . . . . . . . . . . . . . . . . . . . ...
flex actionscript3开发教程合集.flex开发教程合集.zip
Flex权威指南 flex3_actionscript_examples.zip
felx3,flex资料,flex教程,ActionScript3.0中文版.chm,flex3,ActionScript
adobe.press.advanced.actionscript.3.with.design.patterns.nov.2006
Automating.ActionScript.Projects.with.Eclipse.and.Ant(2011.9)
一个塔防游戏源代码.ta fang you xi yuan dai ma . actionscript 3.0
FriendsOfED.Advanced.ActionScript 3.Animation.Dec.2008
flex_api.part3.中文帮助文档,(共4部分)。注意:@@请都下完再解压。 ActionScript 3.0 语言和组件参考是适用于 Flash® Player 应用程序编程接口 (API) 的参考手册。 Adobe Flex 2 语言参考ActionScript 3.0 语言...
完全手册.FLASHFLEX.ACTIONSCRIPT.3.0AS3_24_SQL脚本.rar 完全手册.FLASHFLEX.ACTIONSCRIPT.3.0AS3_24_SQL脚本.rar 完全手册.FLASHFLEX.ACTIONSCRIPT.3.0AS3_24_SQL脚本.rar
Flash.8.ActionScript圣经
Flash.CS3.ActionScript.3.0游戏开发基础与范例【源代码】 让你认识flash 开发游戏 了解flash脚本编写
Peachpit.Press.Fundamentals.of.ActionScript.3.0.Jul.2011.rar
FLEX和Actionscript开发FLASH游戏.rar doc文档