ErrorTestUtils

package domain.utils
{

    public class ErrorTestUtils
    {
        public function ErrorTestUtils()
        {
        }


        public static function isErrorThrown(callMethodThatCausesError:Function,errorReport:String,args:Array):Boolean
        {
            var errorThrown:Boolean = false;
            try
            {
                callMethodThatCausesError.apply(null,args);
            }
            catch(e:Error)
            {
                errorThrown = (e.message == errorReport)
            }

            return errorThrown;
        }

    }

}

Testing Thrown Error Handling

A quick way to test thrown errors are behaving as expected.

[Test]
public function testErrorHandling():void
        {
           

            var errorThrown:Boolean = false;
           
            try
            {
                callMethodThatCausesError();
            }
            catch (e:Error)
            {
                errorThrown = (e.message == 'SomeClass.ERROR_IN_DATA_MESSAGE');
            }
           
            assertTrue(errorThrown);
        }

Improving application performance.

Channels endpoints and destinations, AIR and Flex, courtesy of weborb and midnightcoders

Endpoint - this is the URL where AIR/Flex app sends remoting/messaging requests to

Channel - a concept encapsulating the endpoint. Also identifies classes managing the channel on both client and server sides

Destination - identifies a server-side class exposed by WebORB. Used by Flex/AIR client to target method invocations against the referenced class.

Channels are configured in WEB-INF/flex/services-config.xml (and
weborb-services-config.xml if present in your system). Every channel has the "endpoint" element. For example, you have the following
channel definition:

<channel-definition id="my-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint uri="weborb.php"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>

Notice the following line:

<endpoint uri="weborb.php"

"weborb.php" here is actually a URL. The reason it does not look like a URL is because it is relative. If your Flex app is loaded from

http://myhost/foo/AwesomeApp.html

then your application will be sending remoting requests to the following URL:

http://myhost/foo/weborb.php

(This is the reason why WebORB for PHP requires that you put weborb.php into the same directory containing your SWF.)

So how does the client know what channel to use. The answer lies in remoting-config.xml. This is where all the destinations are defined.
Most of the destinations do not explicitly reference the channels. For those, there's a special declaration at the top of remoting-config.xml that establishes the default channel:

<default-channels>
<channel ref="my-amf"/>
</default-channels>

As a result, when you create a RemoteObject to talk to GenericDestination, remoting requests will be sent to the endpoint defined in the my-amf channel.

Now, suppose you need to get AIR to talk to WebORB. Obviously the my-amf channel will not work for you since the endpoint is relative.
You can definitely change the endpoint to be an absolute URL and it will solve the problem. Alternatively, take a look at the channel with
the following ID:

my-air-amf

Notice the endpoint URL for that channel is absolute. Now take a look at the GenericAIRDestination destination in remoting-config.xml. You will see it references the my-air-amf channel. As a result, if your
AIR application uses "GenericAIRDestination", your AIR client will talk to WebORB and send remoting requests to the endpoint URL from the
my-air-amf channel. It is important to adjust the URL to reflect the location of your WebORB instance.

 

For more info see:

http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=lcconf...

Using Enterprise Architect to create a Class Model from an AS project.

1. Open EA the application.
2. From the app (if plugin in Eclipse select the Enterprise Architect option then ) Create a New Project.
3. Navigate to where you want your project to placed.
4. Your Project Browser perspective should be open and you'll see a tab called Model this is the project you've just created  a project is a collection models in EA. Select it.
5. Right Click on this and select 'Add a new model' using wizard.
6. Check the class model box. and Ok this, a class model icon will appear under the model icon in your project.
7. Right Click on the Class Model folder looking icon (not the blue one).
8. Mouse Over Code Engineering and select 'Import Source Directory'.
9. In the dialog box select ActionScript ensure file extension are .as and the options you prefer
10. Choose the Root Directory you want to generate a Class Model for.

11. To generate rtf documentation select the icon 4th from right on the toolbar with OR select F8 it looks like lines with ticks and crosses although there are two of them.

Mockito Test Structures

/*    Generalisation for verifying a method (testedFunction) of system under test (sut)
            is called that depends on a method (someOperation) of (dependency)
           
            var dependency:Dependency = Dependency(mock(Dependency));
            // given
            var sut:Sut = new Sut(dependency);
            // when
            sut.testedFunction(10);
            // then
            mockito.verify().that(dependency.someOperation(10));
        */

flash flex links and resources courtesy of jexchen hence some chinese characters!

APIs、Libs、Components APIs, Libs, Components

1、 as3ebaylib 1, as3ebaylib

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

2、 as3youtubelib 2, as3youtubelib

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

3、 as3flickrlib 3, as3flickrlib

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

4、 Yahoo ASTRA Flash Components 4, Yahoo ASTRA Flash Components

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

5、 facebook-as3 5, facebook-as3

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

6、 as3awss3lib 6, as3awss3lib

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

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

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

8、 Tweener用 于过渡与切换的一组动画库 8, Tweener for the transition and to switch a group of animation library

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

9、 uicomponents-as3一 组轻量级的AS3 UI组件库 9, uicomponents-as3 a lightweight AS3 UI component library

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

10、 as3ds AS3的数据结构实现 10, as3ds AS3 data structures to achieve

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

 

11、 mecheye-as3-libraries一 组主要用于Flash 游戏开发的AS3库 11, mecheye-as3-libraries of a major group of game development for Flash AS3 library

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

12、 XIFF一 套XMPP协议的AS3实现 12, XIFF AS3 implementation of a XMPP protocol

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

13、 FZip一 套AS3库,可用作对ZIP压缩文件的载入、修改与创建 13, FZip a AS3 library can be used as the load on the ZIP compressed files, modify and create

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

14、 FlexLib一 套开源的Flex界面组件库 14, FlexLib a set of open source Flex component library interface

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

15、 AnimatedGIfLoader Flex Component可载入GIF的Flex组件 15, AnimatedGIfLoader Flex Component can be loading GIF in Flex component

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

16、 goplayground一 套轻量级的,可用创建属于你自己的AS3 动画工具的库 16, goplayground a lightweight, can be used to create your own AS3 animation tools library

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

17、 AlivePDF开 源的用于PDF创建的AS3库 17, AlivePDF open source library for PDF creation in AS3

http://www.alivepdf.org/ http://www.alivepdf.org/

18、 jwopitz-lib一 组开源的Flex用户界面组件 18, jwopitz-lib a set of open source Flex user interface components

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

19、 as3crypto AS3实现的一套加密库,包括多种加密算法 19, as3crypto AS3 implementation of a cryptographic library, including a variety of encryption algorithms

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

20、 flare一 套强大的可视化交互的AS3类库 20, flare of a powerful visual interactive AS3 library

http://flare.prefuse.org/ http://flare.prefuse.org/

21、 SWFAddress一 小而强大的库,可以为Flash和Ajax提供深链接的功能 21, SWFAddress a small but powerful library for Flash and Ajax features to provide deep links

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

22、 SWFObject用 于嵌入Flash,Adobe官方也认可了 22, SWFObject to embed Flash, Adobe has officially recognized

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

23、 ulse Particle System一套开源的强大的AS3动态粒子系统 23, ulse Particle System a set of open source AS3 powerful dynamic particle system

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

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

24、 SpringGraph Flex Component 24, SpringGraph Flex Component

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

25、 GoASAP AS3动画库 25, GoASAP AS3 Animation Library

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

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

26、 asaplibrary一 套开源的Flash Actionscript3.0 RIA库 26, asaplibrary a set of open source Flash Actionscript3.0 RIA Library

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

http://asaplibrary.org/ http://asaplibrary.org/

http://asapframework.org http://asapframework.org

27、 as3mathlib开 源Flex/Actionscript数学库 27, as3mathlib open source Flex / Actionscript Math Library

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

28、 as3corelib包 含一些基础功能AS3库 28, as3corelib AS3 library contains some basic functions

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

29、 minimalcomps一 组AS3 UI组件 29, minimalcomps a AS3 UI Components

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

30、 as3gif 30, as3gif

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

31、 queueloader-as3一 组AS3库,用来进行资源序列载入及监测 31, queueloader-as3 a AS3 library sequence used for loading and monitoring resources

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

32、 TweenMax (AS3) 32, TweenMax (AS3)

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

33、 Atellis Reflection Component一款Flex反射效果组件 33, Atellis Reflection Component effect of a reflection component Flex

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

34、 AS3Eval简 单来说,就是用AS3实现的AS3编译器 34, AS3Eval simply put, is realized with AS3 AS3 compiler

http://eval.hurlant.com/ http://eval.hurlant.com/

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

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

36、 AS3C针 对AVM2虚拟机,用C#写的字节码编译器 36, AS3C for AVM2 virtual machine, using C # to write the byte-code compiler

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

37、 as3httpclientlib as3实现的http客户端 37, as3httpclientlib as3 http client implementation

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

38、 as3ui一 组常规的as3 ui界面库 38, as3ui a conventional as3 ui interface library

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

39、 as3xls让 你在flex中可以读写Excel文件 39, as3xls so you can read and write Excel files flex

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

40、 as3flexdb让 你的flex程序可以连接到MySQL服务器,主要是使用AMFPHP来访问PHP服务器 40, as3flexdb the flex program you can connect to the MySQL server, mainly to access the PHP server using AMFPHP

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

这一是一篇详 细使用介绍的教程 This is a detailed tutorial on using the description

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

41、 vivisectingmedia-as3一 组AS3/Flex实用库,是作者在实践中总结出来的 41, vivisectingmedia-as3 a AS3/Flex utility library, is the author summed up in practice

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

42、 assql通 过ActionScript 3.0 直接连接MySQL 数据库 42, assql direct connection through the MySQL database ActionScript 3.0

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

43、 FlexserverLib Flex & BlazeDS服务端扩展 43, FlexserverLib Flex & BlazeDS server-side extension

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

http://www.infoaccelerator.net/blog/post.cfm/announcing-flexserverlib-the-blazeds-extension-project http://www.infoaccelerator.net/blog/post.cfm/announcing-flexserverlib-the-blazeds-extension-project

44、 dphibernate Flex/BlazeDS Hibernate Adapter ,支持延迟加载 44, dphibernate Flex / BlazeDS Hibernate Adapter, to support lazy

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

45、 as3syntaxhighlight as3及mxml代码高亮库 45, as3syntaxhighlight as3 and mxml code highlighting library

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

46、 Tweensy一 款新的缓动及运动效果库 46, Tweensy a new slow moving and their effect libraries

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

47、 JSwoof the fastest JSON parser for Flex 47, JSwoof the fastest JSON parser for Flex

http://www.waynemike.co.uk/jswoof http://www.waynemike.co.uk/jswoof

48、 casa lib it provides a core set of classes,interfaces,and utilities 48, casa lib it provides a core set of classes, interfaces, and utilities

http://casalib.org/ http://casalib.org/

49、 FlipCard 3D Flip Card for Flex 49, FlipCard 3D Flip Card for Flex

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

50、 Efflex一 组特效库 50, Efflex a set of effects library

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

http://www.efflex.org/ http://www.efflex.org/

51、 ObjectHandles一 组能用UI组件,允许你对组件进行绽放与移动 51, ObjectHandles a set of UI components can be used, allowing you to blossom and move on components

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

http://code.google.com/p/flex-object-handles/wiki/ObjectHandlesUsage http://code.google.com/p/flex-object-handles/wiki/ObjectHandlesUsage

52、 as3commons一 组as3通用库 52, as3commons a common library as3

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

http://www.as3commons.org/ http://www.as3commons.org/

53、 urlkit为 Flex应用程序提供URL deep linking深度链接的库 53, urlkit for the Flex application to provide the depth of the link URL deep linking library

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

54、 standingwave音 频合成的Flash/Flex库 54, standingwave audio synthesis of Flash / Flex Library

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

Actionscript 3.0 Class Actionscript 3.0 Class

1、 fZip此 类可允许你载入标准的zip文件并提取里面包含的文件 1, fZip such standards may allow you to load and extract the zip file which contains the file

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

2、 AS3: Layout class for Flash CS3一组用作布局的类 2, AS3: Layout class for Flash CS3 for the layout of a class

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

3、 CSSLoader该 类允许Flex应用程序在运行时载入CSS 3, CSSLoader class allows Flex applications to run when loading CSS

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

4、 AS3: QueryString一个单例类,用来获取URL地址后所带参数值对 4, AS3: QueryString a singleton class, used to obtain the URL address of the parameter values brought

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

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

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

6、 Spark project一系列丰富的AS3库,小日本开发 6, Spark project a rich set of AS3 libraries, small-Japan Development

http://www.libspark.org/wiki/WikiStart/en http://www.libspark.org/wiki/WikiStart/en

2D & 3D Engine 2D & 3D Engine

1、 APE (Actionscript Physics Engine)  物理引擎 1, APE

Using registerClassAlias

NOTE: registerClassAlias should be called before any instances of the class you are aliasing is instantiated!!!!!

The contents of this message and any attachments to it are confidential and may be legally privileged. If you have received this message in error you should delete it from your system immediately and advise the sender. dunnhumby may monitor and record all emails. The views expressed in this email are those of the sender and not those of dunnhumby.