Flash Builder ASDoc注释参数简介

在Flash Builder的ASDoc注释工具中经常会用到一下注释参数:

@author –作者信息,似乎对@等特殊字符有屏蔽作用

@param –函数参数信息,若有多个参数,可分行
@return — 函数返回类型描述
@throws –抛出异常描述信息
@see –参见代码信息

需要注意的一个地方是@see, 当需要see某个类中的函数时

@see Array#pop();

需要see本类某函数时,如需要see下本类的 fieldStringToLocalizationItem(fieldString:String, strict:Boolean = true)函数, 则|

@see #fieldStringToLocalizationItem() ;

以上列举的只是部分常用的注释参数,以后有机会可以补充。

-source-path, 该path指明了源代码存放的位置

-doc-classes, 需要生成目录的类 , 在使用该变量之前必须已经声明-source-path;

常用开源类库

转过来的常用类库。
1、as3ebaylib

http://code.google.com/p/as3ebaylib/

2、as3youtubelib

http://code.google.com/p/as3youtubelib/

3、as3flickrlib

http://code.google.com/p/as3flickrlib/

4、Yahoo ASTRA Flash Components

http://developer.yahoo.com/flash/astra-flash/

5、facebook-as3

http://code.google.com/p/facebook-as3/

6、as3awss3lib

http://code.google.com/p/as3awss3lib/

7、Adobe ActionScript 3:resources:apis:libraries (官方,包括corelib、FlexUnit、Flickr、Mappr、RSS and Atom libraries、Odeo、YouTube)

http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries

8、Tweener 用于过渡与切换的一组动画库

http://code.google.com/p/tweener/

9、uicomponents-as3 一组轻量级的AS3 UI组件库

http://code.google.com/p/uicomponents-as3/

10、as3ds AS3的数据结构实现

http://code.google.com/p/as3ds/

11、mecheye-as3-libraries 一组主要用于Flash 游戏开发的AS3库

http://code.google.com/p/mecheye-as3-libraries/

12、XIFF 一套XMPP协议的AS3实现

http://svn.igniterealtime.org/svn/repos/xiff/branches/xiff_as3_flexlib_beta1/

13、FZip 一套AS3库,可用作对ZIP压缩文件的载入、修改与创建

http://codeazur.com.br/lab/fzip/

14、FlexLib 一套开源的Flex界面组件库

http://code.google.com/p/flexlib/

15、AnimatedGIfLoader Flex Component 可载入GIF的Flex组件

http://dougmccune.com/blog/animatedgifloader-flex-component/

16、goplayground 一套轻量级的,可用创建属于你自己的AS3 动画工具的库

http://code.google.com/p/goplayground/

17、AlivePDF 开源的用于PDF创建的AS3库

http://www.alivepdf.org/

18、jwopitz-lib 一组开源的Flex用户界面组件

http://code.google.com/p/jwopitz-lib/

19、as3crypto AS3实现的一套加密库,包括多种加密算法

http://code.google.com/p/as3crypto/

20、flare 一套强大的可视化交互的AS3类库

http://flare.prefuse.org/

21、SWFAddress 一小而强大的库,可以为Flash和Ajax提供深链接的功能

http://www.asual.com/swfaddress/

22、SWFObject 用于嵌入Flash,Adobe官方也认可了

http://code.google.com/p/swfobject/

23、ulse Particle System 一套开源的强大的AS3动态粒子系统

http://code.google.com/p/pulse-particle/

http://www.rogue-development.com/pulseParticles.html

24、SpringGraph Flex Component

http://mark-shepherd.com/blog/springgraph-flex-component/

25、GoASAP AS3动画库

http://code.google.com/p/goasap/

http://www.goasap.org/index.html

26、asaplibrary 一套开源的Flash Actionscript3.0 RIA库

http://code.google.com/p/asaplibrary/

http://asaplibrary.org/

http://asapframework.org

27、as3mathlib 开源Flex/Actionscript数学库

http://code.google.com/p/as3mathlib/

28、as3corelib 包含一些基础功能AS3库

http://code.google.com/p/as3corelib/

29、minimalcomps 一组AS3 UI组件

http://www.bit-101.com/minimalcomps/

30、as3gif

http://code.google.com/p/as3gif/

31、queueloader-as3 一组AS3库,用来进行资源序列载入及监测

http://code.google.com/p/queueloader-as3/

32、TweenMax (AS3)

http://blog.greensock.com/tweenmaxas3/

33、Atellis Reflection Component 一款Flex反射效果组件

http://labs.atellis.com/2007/07/11/atellis-reflection-component/

34、AS3Eval 简单来说,就是用AS3实现的AS3编译器

http://eval.hurlant.com/

35、ByteArray的组件、库合集,包括liquid components、mousegesture、ASZip、GIF Player、GIF Animation Encoder、AlivePDF、Live JPEG Encoder、ScaleBitmap等

http://www.bytearray.org/?page_id=82

36、AS3C 针对AVM2虚拟机,用C#写的字节码编译器

http://code.google.com/p/as3c/

37、as3httpclientlib as3实现的http客户端

http://code.google.com/p/as3httpclientlib/

38、as3ui 一组常规的as3 ui界面库

http://code.google.com/p/as3ui/

39、as3xls 让你在flex中可以读写Excel文件

http://code.google.com/p/as3xls/

40、as3flexdb 让你的flex程序可以连接到MySQL服务器,主要是使用AMFPHP来访问PHP服务器

http://code.google.com/p/as3flexdb/

这一是一篇详细使用介绍的教程

http://itutorials.ro/viewtopic.php?f=9&t=7

41、vivisectingmedia-as3  一组AS3/Flex实用库,是作者在实践中总结出来的

http://code.google.com/p/vivisectingmedia-as3/

42、 casalib

http://casalib.org

Actionscript 3.0 Class
1、fZip 此类可允许你载入标准的zip文件并提取里面包含的文件

http://wahlers.com.br/claus/blog/zip-it-up/

2、AS3: Layout class for Flash CS3 一组用作布局的类

http://www.senocular.com/?id=2.8

3、CSSLoader 该类允许Flex应用程序在运行时载入CSS

http://www.rubenswieringa.com/blog/cssloader

4、AS3: QueryString 一个单例类,用来获取URL地址后所带参数值对

http://evolve.reintroducing.com/2008/07/03/as3/as3-querystring/#more-141

5、ActionScript 3 Contextual Menu Manager Class AS3关联菜单管理类

http://www.blog.noponies.com/archives/103

2D & 3D Engine
1、APE (Actionscript Physics Engine) 物理引擎
APE前身是as2版本的Flade,呼声很高,优点就是清晰简单,一共没有几个类:),目前版本alpha 0.45 ,有API文档和示例,教程有一篇quick start ,在Google Group上有一个论坛可以讨论。svn上一直在更新目前svn上的版本为0.5a

http://www.cove.org/ape/

2、Away3D

http://code.google.com/p/away3d/

3、Papervision3D

http://code.google.com/p/papervision3d/

4、Sandy 开源3D库

http://www.flashsandy.org/versions/3.0

5、FORM 一套AS3完成的用于2D刚性物体的物理引擎

http://code.google.com/p/foam-as3/

6、Five3D 基于矢量的Flash 3D 交互动画创建

http://five3d.mathieu-badimon.com/

7、Flade (Flash Dynamics Engine) 一套开源的2D物理引擎,AS2实现

http://www.cove.org/flade/

8、Box2DFlashAS3 2D物理引擎,AS3实现,基于强大的Box2D C++物理库

http://box2dflash.sourceforge.net/

9、Paradox 基于Flash的第一称3D引擎

http://animasinteractive.com/propaganda/

10、ND3D AS3 3D Engine  一款简单的AS3开源3D引擎,编译后的引擎大小仅约10K

http://code.google.com/p/nd3d/

http://www.nulldesign.de/nd3d-as3-3d-engine/

11、motor2 基于Box2d的AS3刚体引擎,也是2D的.
作者就是 AS3数据结构的作者,2007年最后一天发布
作者主页:http://lab.polygonal.de/motor_physics/
代码:http://code.google.com/p/motor2/
12、WOW-Engine 法国人写的,基于Sandy library的算法 3D物理引擎

http://seraf.mediabox.fr/wow-engine/as3-3d-physics-engine-wow-engine/

FrameWorks
1、Cairngorm Adobe官方出的Flex框架

http://labs.adobe.com/wiki/index.php/Cairngorm

2、PureMVC 纯AS3框架,也有其它语言的实现

http://www.puremvc.org/

3、ASWing AS3 一套开源的AS3 GUI框架

http://www.aswing.org/

4、EasyMVC 由事件驱动的MVC框架

http://projects.simb.net/easyMVC/

5、Mate 基于Tag及事件驱动的Flex框架

http://mate.asfusion.com/

6、ARP 基于模式(Pattern)的RIA框架,Flash平台,支持AS2和AS3

http://osflash.org/projects/arp

7、Gaia 开源的Flash前端框架,支持AS2和AS3,用于快速开发

http://www.gaiaflashframework.com/

8、flest Actionscript3.0/Flex应用程序框架,用来开发企业级的RIA

http://code.google.com/p/flest/

9、Gugga Flash Framework 更新至AS3

http://www.gugga.com/flashblog/

10、Prana 另一个提供了IOC反转控制的框架,类似著名的Spring框架

http://www.pranaframework.org/

11、OpenFlux 开源的Flex组件框架,让开发Flex组件更加快速容易

http://code.google.com/p/openflux/

12、Degrafa 声明式的Flex图形框架,允许以MXML标签的方式绘制图形、创建皮肤,还包括对CSS的支持

http://code.google.com/p/degrafa/

13、FlexMVCs 针对AS3和Flex的应用程序框架,基于PureMVC,作了些修正和精简

http://code.google.com/p/flexmvcs/

Flash & Flex Tools、Servers
1、FlexUnit Flex/Actionscript3.0单元测试框架

http://code.google.com/p/as3flexunitlib/

2、Visual FlexUnit 增强的FlexUnit,支持“可视化断言”

http://code.google.com/p/visualflexunit/

3、RED bug debug调试控制器,让Flash、Flex、AIR应用程序更加容易

http://www.realeyesmedia.com/redbug/

4、reflexutil 可在运行时对Flex组件进行调试

http://code.google.com/p/reflexutil/

5、FxSpy 当Flex应用程序运行时可以检测和动态的改变可视化组件属性值

http://code.google.com/p/fxspy/

6、ThunderBolt 基于Firefox的Firebug插件的日志扩展,支持AS2及AS3

http://code.google.com/p/flash-thunderbolt/

7、FlashTracer Firefox扩展,可以以侧栏的方式将Flash中trace()的结果显示
8、RIALogger 另一款Flex/AIR的Debug工具

http://renaun.com/blog/flex-components/rialogger/

9、Alcon 一款轻量级的AS2及AS3的Debug工具,AIR方式将Debug信息展示出来

http://blog.hexagonstar.com/alcon/

10、GDS (Granite Data Services) 开源,提供了Adobe LiveCycle Data Services类似功能的服务器

http://www.graniteds.org/

Flex Explorers (大部分为Flex2版本,但同样适用于Flex3)
1、Flex3 Component Explorer Flex各类组件示例

http://examples.adobe.com/flex3/componentexplorer/explorer.html

2、Resize ManagerFX Explorer (此为商业作品,要收费的)

http://www.teotigraphix.com/explorers/ResizeManagerFX/ResizeManagerFXExplorer.html

3、Flex3 Style Explorer

http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html

4、Flex2 Style Explorer(添加了Kuler功能)Flex UI组件风格定制并可输出为CSS

http://www.maclema.com/content/sek/

5、Flex2 Style Explorer(Adobe 原始的版本)

http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplorer.html

6、Flex2 Filter Explorer 查看各类滤镜效果并可进行设置

http://merhl.com/flex2_samples/filterExplorer/

http://merhl.com/?p=40 (AIR版本)
7、Flex2 Primitive Explorer 在Flex中创建各种简单形状

http://www.flexibleexperiments.com/Flex/PrimitiveExplorer/Flex2PrimitiveExplorer.html

Sourcemate插件安装

关于Sourcemate的介绍就不多说了,看这里。 安装方式也很简单,打开FlashBuilder,选择Install a new software,然后输入插件的地址: http://updates.elementriver.com/sourcemate/v1 安装后,修改Host文件,添加: 127.0.0.1 services.elementriver.com 然后重启Flash Builder,输入Sourcemate的序列号: email:随便 序列号 :X777-C111-Z999-Y888 该插件是需要付费的,本文仅供学习和参考,如果您喜欢此软件,请支持正版。
Artist – Song

tutorial: Flex + AMFPHP + POG

Preface

If you are no stranger to the concept of a Rich Internet Application (aka. RIA) and the different constituents that make up a RIA, you can skip this introduction. This tutorial will help developers to setup a Flex application to a database using PHP while minimizing manual database queries. Let’s familiarize ourselves with a few basic RIA concepts. Generally a RIA is comprised of 3 main components:

* the client – no, not your client that sends the checks, but rather the Graphical (User) Interface that a user of a RIA interacts with. In our case, this the flex client that is deployed to a particular URL.
* the service layer -this component is the hidden part of the application that interprets client events, requests information stored on a database, and then sends the requested data back to the client. In our case AMFPHP, PHP and POG will be in this category. I will explain what these mean in a bit.
* the database – this is where our data is stored. In my case this is MySQL. Depending on your local setup, you may be using a different database.

For most of this tutorial we will be dealing with the client and the service layer. The service layer will be comprised of AMFPHP which is a very small framework which facilitates remoting between Flex and PHP. Remoting is simply a means to send and receive native ActionScript objects to a service layer. POG is another small framework for taking PHP objects and allowing CRUD methods for their database counterparts. CRUD stands for Create, Read, Update and Delete and POG simply stands for PHP Object Generator. In our case, we are setting up a RIA so that the objects sent to and from Flex will easily be able to be manipulated via CRUD methods. To sum this up we are establishing a seamless means of having Flex and a database to communicate with a minimum amount of manual data manipulation. If that confused the hell out of you, I apologize as I am kinda new to making tutorials.
Resources

POGTestApp client & server – link
AMFPHP v1.9 20070513 – link
POG – link
The Quest

Anyone who frequents this blog know that I have been on a mission for some time to get some sort of ORM setup for my pet-project. I didn’t want to be encumbered by a heavy framework with a complex API or inheritance structure. I’d looked at CakePHP, Doctrine, Propel, Junction and a few others. As a non-PHP guy, I found all of those to be overwhelming. I’d rather spend my time coding than having to read config documentation or learn a new API. That is not to say that I don’t want to learn something new, I do. I just felt enough of my time had been spent trying to find the right solution. The right solution had to be ultra-simple and intuitive.
Enter POG

POG stands for PHP Object Generator. I’ll spare you my praises of it for now (you can read up on their site if you like). Suffice it to say it is an ORM framework that is simple, intuitive and light weight. And it works for me. This looks like a long read, and it is, but it will go rather quickly. Lot’s of pictures too!!!
Your first Flex + AMFPHP + POG RIA
Server setup

I have my project setup in two places. One location is where my deployable flex content, AMFPHP and POG code goes. The other is simply where I house my Flex project source. Here is a pic of the deploy location:

picture-2.png

I use MAMP (Mac + Apache + MySQL + PHP) which is a turnkey PHP server. It works well for me because I really didn’t like doing all the Terminal setup to get my Mac’s built in PHP setup for this. If my project makes it to the big time, then all this server side setup will be delegated to a more knowledgeable person who can set it up better than I have.
AMFPHP

Firstly I want to tackle the AMFPHP part since its probably the most straight forward part of the process. Go and download AMFPHP 1.9. I am using the 20070513 release. Once downloaded, unzip it and place it in the aforementioned deploy location. The only things you need to do for AMFPHP is:

* make note of you services folder (I put a symlink to the whole AMF folder in my flex project so I could have direct access to it from within Eclipse without having to use the bin folder).
* adjust the following information on the globals.php
o $servicesPath – in my case “services/”
o $voPath – this will point to your POG objects folder once we get it setup, in my case “../pog/objects/”

That is all on the AMFPHP aside from constructing your services.

[EDIT 2008.03.21]

Since initially this tutorial only happened to touch upon the setup of these technologies there hadn’t been any issues encountered. Obviously this tutorial didn’t reflect a real implementation of such a setup beyond the simple Get method. Further development has turned up an interesting find about sending AS3 objects out from Flex to be mapped to a POG object. As it is now, it can’t. That is because the naming convention chosen by the POG framework doesn’t get picked up by the AMFPHP deserializer. My gunslinger buddy Renaun Erickson has found a simple solution for this that doesn’t break the POG naming convention. You can read more about it on his blog – link.

You need to open the AMFBaseDeserializer.php and insert the following code at line 384:

elseif(file_exists($GLOBALS['amfphp']['customMappingsPath'] . ‘class.’ . strtolower($mappedClass) . ‘.php’))
{
$include = $GLOBALS['amfphp']['customMappingsPath'] . ‘class.’ . strtolower($mappedClass) . ‘.php’;
}

POG

POG is unique in that you don’t just go and download a framework (at least not yet). If you visit POG, you are greeted with a little RIA that takes some information about the object you want to create. I decided to use the name TestObject and give it two properties: userName and password both being varchar(255). Just to reiterate, I am using the PHP5.1+ along with the POG database wrapper:

picture-3.png

Notice that I am NOT using the PDO mysql wrapper. Reason being that AMFPHP has issues finding the mysql PDO driver and not everyone’s php environment contains those. So let’s stick to the POG database wrapper.

Since this is the first interaction with POG, we want to download the full framework in addition to you new object:

dlzip.png

Then unzip the file, rename it simple as “pog” and place it in your deployment location. Next locate the {yourMainDeploymentFolder}/pog/configuration.php and update the needed information so that POG can access your database. Here is a snap of mine:

configs.png

Notice that I have my mysql port set to 8889 rather than the default 3306? Also the plugin settings url is an absolute path. In your browser navigate to the following location: http://localhost{:yourPort}/{yourMainDeploymentFolder}/pog/setup/index.php. Go through the initial welcome/setup screen. POG will do some quick unit test, and if everything goes well, you are then presented with a portal to do basic CRUD methods on your new POG object. This is useful because we can setup a few test objects to use in setting up and testing the Flex application.

Now it would appear that POG is ready to go. And you’d be correct if you just want to use the local POG portal to play with it. In order to get it working with Flex and AMFPHP, you need to fix a few things with a few classes in POG. We will come back to that after we get the Flex project setup.
Flex

I am providing my POGTestApp source for you to download, but I also want you to see the steps necessary to do it yourself. First let’s create a new Flex project. I called mine POGTestApp. Now I also have mine located in a different place than the deployment location so I used some advanced options:

flexpath.png

In the provided flex project, I have the Cairngorm.swc in the libs folder. Make sure to add the libs folder to the library path. Also point it to the services-config.xml:

picture-5.png

Open the services-config.xml and make sure to modify the endpoint uri to point to your amfphp gateway.php:

services-config.png

Now at this point you should be able to modify your Services.mxml (ServiceLocator subclass) and add your php services there. If you downloaded the files I have provided, I suggest taking a look at Services.mxml. Since this is a testing application, I have a genericFaultHandler and a genericResultHandler in this file that you can add breakpoints to for debugging purposes. So even though I am making the calls from the application file without any responders, I am still listening for them in Services.mxml. Now if you decide to make some calls of you own, without using my files, you will notice that you get some errors or it just doesn’t seem to work. That is because POG needs some adjustments to work properly.
POG adjustments

Even though POG works inside the provided POG setup.php, it won’t want to play with Flex or AMFPHP unless you give it some help. Here are a few things to modify:

* open the class.database.php and hardcode your configuration.php settings in there. For some reason the global vars are not making through to the Database class. Since I suck at php, I was advised to put it here until a better solution is found.
* open the class.testobject.php (or whatever your POG object is named) and add the remoting string: var $_explicitType = YourRemotingClassNameHere.
* also add include_once(‘class.database.php’);to class.testobject.php.

That should do it. Make your own or use the POGTestingServices and play with it. Keep in mind that even though my provided files work, you might get some PHP specific errors that appear to fail silently. If you experience this behavior you need to check your php.log to see what the issue is. Generally its due to the remoting code rather than the POG code.
Retrospective

I really like the idea of remoting for prototyping. It takes the hassle away from having to parse your responses in flex. POG is an ideal solution for developers not that familiar with PHP as the objects translate rather easily and since it is OO, its easy to do the mysql input without having to get involved with writing queries.

When time is of the essence, maybe you will consider this beautifully simple solution. Thanks goes out to Joel Wan (POG) and Renaun Erickson (the gunslinger) for help sorting this out. Let me know if you have any advice, suggestions, criticism and or corrections for this tutorial.

Possibly related posts: (automatically generated)

* CF Tutorials
* Empower Your Development Skill with the Latest Flex Actionscript 3
转自:http://jwopitz.wordpress.com/2008/03/12/tutorial-flex-amfphp-pog/