Tuesday, December 21, 2010

Popup Scopes and easy way to close all open Popups

While creating popup we can define the scope of the popup (i.e where the popup list is maintained ) by defining detail parameter while creating or adding a popup. The PopUpManagerChildList class defines constants for the detail property for the PopUpManager addPopUp() and createPopUp() methods.

systemManager isntance has a "popUpChildren" variable which maintains list of all popups created in PopupManagerChildList.POPUP scope. Thus we can easily remove all the popups created in this scope using the following snippet:

while (systemManager.popUpChildren.numChildren > 0){
PopUpManager.removePopUp(IFlexDisplayObject(systemManager.popUpChildren.getChildAt(0)));
}


While creating popup use the following signature:

        PopUpManager.createPopUp(this, class ,modalValue,PopUpManagerChildList.POPUP) ;
or
        PopUpManager.addPopUp(popupInstance,this,false,PopUpManagerChildList.POPUP);

Sunday, December 19, 2010

ActionScript Code Coverage Plug-in for Flash Builder

This is pretty good feature which will help us to test all loops and conditions in an application. Thus we cover all the conditions and help us avoid last minute embarrassment.

Snippets from documentation:
Adobe® ActionScript® Code Coverage Plug-in for Adobe Flash® Builder™, a tool that helps ActionScript and Adobe Flex® developers understand exactly what code is executed while an application is running.

When added to Flash Builder, the plug-in provides a new Eclipse perspective that allows you to start/stop the code coverage tool, view generated reports, examine source code and save/load reports. Typically developers will use the code coverage tool to see which areas of code have not been exercised during execution so that additional testing requirements can be identified.

The tool provides detailed line coverage and method coverage reporting, as well as highlighting classes that are not linked into the application. You can use the ActionScript Code Coverage Plug-in for Flash Builder with applications developed in ActionScript 3, optionally using either Flex SDK 3.x or Flex SDK 4.x, targeting both Adobe Flash Player and Adobe AIR®. A trial or licensed version of Adobe Flash Builder 4 Premium is required to use the ActionScript Code Coverage Plug-in.


Link: http://labs.adobe.com/technologies/ascode_coverage/

Friday, December 17, 2010

Swiz Framework

Today I have come across this simple, lightweight flex micro-architecture framework. It provides :

  • Inversion of Control / Dependency Injection
  • Event handing and mediation
  • A simple life cycle for asynchronous remote methods
  • A framework that is decoupled from your application code
I went through the documentation and features of this framework, as promised the framework is simple, lightweight and easy to use in any size-project.

No harm in considering this framework for your project.

Here is the link.