天生我才必有用

ActionScript 3 libraries

分类: Flex, Flash & AS    作者:Ray    2008年10月10日
  1. as3ebaylib is a library for accessing eBay’s XML API through ActionScript.
  2. as3corelib is a collection of classes and utilities that make ActionScript development easier.
  3. as3flexunitlib is a unit testing framework for Flex development.
  4. as3odeolib is an ActionScript library for retrieving podcasts from the Odeo service.
  5. as3youtubelib is a library for accessing the YouTube data API.
  6. as3syndicationlib provides a single interface for dealing with RSS and Atom feeds.
  7. as3flickrlib is a library for consuming the Flickr API.
  8. as3mapprlib provides access to the Mappr API that combines Flickr and geo-tagged information.
  9. Cairngorm is a framework for developing Flex-based rich Internet applications.

Actionsript 3.0中的数组

分类: Flex, Flash & AS    作者:Ray    2008年04月21日

1. 包含两个字符串的数组

  • [”boy”, “girl”]

2. 数组中可以包含任意类型的数据,如字符串和数字等,设置可以包含另一个数组类型的数据

  • [”boy”, 1 , “girl” , 2]
  • [”month end days”, [31, 30, 28]]

3. 可以把数组赋值给一个数组变量

  • var game:Array = [”EA”, 175];

4. 使用new来创建数组变量

  • new Array(14) // 创建包含14个空数据的数组。
  • new Array(”sun”, “moon”, “earth”) //创建了包含3个字符串的数组,等同于[”sun”,”month”,”earth”]。

5. 访问数组元素 []

var trees:Array = [”birch”, “maple”, “oak”, “cedar”];

var firstTree:String = trees[0];

trees[0] = “oak2″;

6. 取得数组长度length

var trees:Array = [”birch”, “maple”, “oak”, “cedar”];

var len:int = trees.length;

7. 往数组中添加元素

  • var fruits:Array = [”apples”, “oranges”, “pears”]; fruits[3] = “tangerines”;
  • var colors = [”green”, “red”, “blue”];  colors.length = 50;
  • push( )方法,把新的元素添加到数组尾部。
  • unshift( )方法,把新的元素添加数组首部。
  • splice( )方法
  • concat( )方法

8. 从数组中删除元素

  • delete 操作符:var list = [”a”, “b”, “c”]; delete list[2];
  • var toppings:Array = [”pepperoni”, “tomatoes”, “cheese”]; toppings.length = 2;
  • splice( )
  • pop( ) :和push( )相反。
  • shift( ):和unshift( )相反。

Flash中Display控件常用属性及方法

分类: Flex, Flash & AS    作者:Ray    2008年04月9日

1. 坐标 x, y

ball.x =3
ball.y = 4

2. 宽和高

ball.height = 100
ball.weight = 200

3.宽高比例

ball.scaleX = 2
ball.scaleY = 0.5

按比例宽扩大2倍,高缩小一半。

4. 透明度

ball.alpha = 0.5

alpha 可以0-1中任意数值,数值越小透明度越高

5.旋转

ball.rotation = 45

旋转45度

6.numChildren
取得子控件的总数

7.z-index

getChildIndex(ball1) //取得ball1子控件的z-index位置
setChildIndex(ball1, numChildren-1); //把ball1子控件放到当前控件的最前面(top)
swapChildren(ball2, ball3); //交换ball2和ball3的z-index位置
swapChildrenAt(0, 2); //交换z-index位置0和2上的子控件