天生我才必有用

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.

Flash Open Source 相关站点

分类: Flex, Flash & AS    作者:Ray    2008年10月10日
  • OSFlash: http://osflash.org
  • OSFlash Mailing List: http://osflash.org/mailman/listinfo/osflash_osflash.org
  • The GAE SWF Project: http://gaeswf.appspot.com
  • Google App Engine: http://code.google.com/appengine/
  • Papervision3D: http://osflash.org/papervision3d
  • Red5: http://osflash.org/red5
  • SWFAddress: http://www.asual.com/swfaddress/
  • PyAMF: http://pyamf.org/
  • Fuse: http://osflash.org/fuse/
  • GoASAP: http://osflash.org/goasap/
  • SWX: http://swxformat.org
  • AMFPHP: http://www.amfphp.org/
  • MTASC: http://mtasc.org
  • swfmill: http://osflash.org/swfmill
  • AMES: http://osflash.org/ames
  • FlashDevelop: http://osflash.org/flashdevelop
  • ASDT: http://osflash.org/asdt
  • PureMVC: http://puremvc.org/
  • Arp: http://osflash.org/arp
  • Cairngorm: http://labs.adobe.com/wiki/index.php/Cairngorm
标签: ,

AIR 应用程序类和窗口类

分类: Flex, Flash & AS    作者:Ray    2008年09月23日

在AIR学习中有两个最基本的类:分别是flash.desktop.NativeApplication和flash.desktop.NativeWindow。它们分别表示AIR应用程序类和窗口类。

每个AIR应用程序必须有一个NativeApplication的实例,同时也只能有唯一的一个这样的实例,当应用程序启动时,它会自动创建,你可以使用NativeApplication类的nativeApplication属性来获得这个实例。

同时应用程序启动时,也会创建一个NativeWindow的实例,和NativeApplication不同的是,你可以自己创建你自己的NativeWindow对象实例。以下为创建NativeWindow的一个例子。

package {
    import flash.display.MovieClip;
    import flash.display.NativeWindow;
    import flash.display.NativeWindowInitOptions;
    import flash.display.NativeWindowType;
    public class Example extends MovieClip {
        public function Example() {
            var options:NativeWindowInitOptions = new NativeWindowInitOptions();
            options.type = NativeWindowType.UTILITY;
            var window:NativeWindow = new NativeWindow(options);
            window.width = 200;
            window.height = 200;
        }
    }
}
标签:

Flex 2 Style Explorer

分类: Flex, Flash & AS    作者:Ray    2008年08月15日

Adobe Flex 支持CSS来定义应用程序的风格,可以采用类似开发网页的方法来实现Flex 应用程序显示风格的定义,同时还提供了一个Sample程序来让大家体验此功能。你可以点击此链接来访问Flex 2 Style Explorer。通过此工具生成的CSS代码可以非常简单的对自己的Flex 程序进行美化。
把此工具生成的CSS复制到mx:Style的标签中,就可以使用了。如范例中定义了一个class的风格。

<mx:Style>
    .labelStyle {
        font-family: 'Arial';
        font-size: 20px;
        font-weight: 'bold';
        color: #FFFFFF;
    }
</mx:Style>
标签:

Adobe AIR - Create Modify Reuse

分类: Flex, Flash & AS, eBook    作者:Ray    2008年06月16日

Adobe AIR 终于出了一本新书,查了一下amazon的评价还不错,评分的人不多,但都给了5分。

简略的流量了一下啊这本书,内容还不错,并无很多篇幅介绍IDE,反而详细介绍了如何使用Flex SDK 来进行编译调试。看来不装Flex Builder3 应该也可以学习这本书了。

接着每一章都是举了一个小例子,非常的实用。慢慢学习,我也会把不错的内容作为笔记写在Blog中。

标签: ,

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( )相反。

Adobe AIR for JavaScript Developers Pocket Guide

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

Adobe AIR 也算出了有一段时间,不过相关的资料比较少,特别是一些系统的、全面的文档资料基本没有。

今天无意间看到一本O’Reilly的电子书《Adobe AIR for JavaScript Developers Pocket Guide》,书也不是很厚176页,准备读一下。我是一直挺看好RIA技术的,特别是Flash在这个方面的发展空间应该挺大的。

如果有兴趣一起阅读,可在以下的emule地址下载:(两个不同的格式PDF和chm)

  1. Adobe air for javascript developers(Apollo).pdf (Beta)
  2. Adobe.AIR.for.JavaScript.Developers.Pocket.Guide.chm(正式版)

chm格式的电子书是2008年出版的针对AIR正式版的书籍。

标签:

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上的子控件

Core Display Classes Illustration in Flash CS3

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

插图为Flash CS3 的核心Display 类的继承关系的图。

  • DisplayObject: At the top of the hierarchy, this class provides the basic properties for all visual items in the display list, such as x, y, width, and height. Everything in the display list is an instance of one of the classes that extends the DisplayObject class, either directly or indirectly.
  • InteractiveObject: This class adds various properties, methods, and events that allow users to interact with display objects using the mouse and keyboard. You’ll learn more about events and how to allow users to interact with display objects.
  • DisplayObjectContainer: This class gives display objects the ability to contain other display objects, which can be manipulated using methods like addChild() and removeChild(). Other display list classes allow a specific number of child display objects. A good example is SimpleButton, which allows you to specify a different display object for each of the button states, but only DisplayObjectContainer instances allow you to have an open-ended number of child display objects.
  • Sprite: This is a new type of object available with ActionScript 3.0, and there is no equivalent in the IDE. Basically, it is like a movie clip without a timeline, so it doesn’t contain any of the timeline controlling ActionScript necessary with MovieClip instances. You can still draw into it, add new display objects to it, and code for interactivity, but it is lighter weight in memory than a movie clip. It is the best bet if you are programmatically creating interactive graphics in your applications.
  • MovieClip: This class adds the concept of frames, frame labels, and scenes, with all the properties and methods you need to query and manipulate the playhead. Note that while you can create MovieClip objects programmatically, you cannot add frames, labels, or scenes with ActionScript code.

以上说明摘录至【Foundation ActionScript 3.0 with Flash CS3 and Flex】

标签: ,

ActionScript 3.0 基础数据类型

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

String: 字符或者字符串 A single character or sequence of characters
Boolean: 布尔类型 只有真和假 true or false values
int: 带符号整型,ActionScript 3.0新增类型 Positive and negative whole numbers (new in the actionscript 3.0)
uint: 无符号整型,ActionScript 3.0新增类型 Positive whole numbers (new in the actionscript 3.0)
Number: 浮点数类型 Positive and negative whole and real (i.e., fractional) numbers

Note:

int and uint are actually low-level numeric types that are a subtypes of Integer (which does not exist in ActionScript), and the lowercase denotes this and also follows syntax shared by other languages like Java, C++, and C#.

标签: