Tuesday, September 7, 2010

Flash : opensource API, librairies, resources

Here are my list of open source google code projects for the Flash Platform. This is what I have seen over time, please add if you feel I missed anything. Many of them mayn0t be useful, or may be discontinued. This is from my list of os projects

  1. adobe-air-util - Adobe AIR AS3 Utility classes, no much updates.
  2. appcorelibOpen Source Flex Application Core Library
  3. as3awss3lib – ActionScript 3.0 library for interacting with Amazon S3
  4. as3barcodelibAn Actionscript 3 barcode decoding library
  5. as3bloggerlibActionscript 3.0 Library for Blogger Data API
  6. as3cannonballDOM+HTML+CSS+Browser Library for ActionScript 3.0
  7. as3corelib

    ActionScript 3.0 library for several basic utilities.

  8. as3cryptoCryptography library for ActionScript 3, including partial TLS 1.0 support
  9. as3dsAS3 Data Structures For Game Developers
  10. as3ebaylibActionScript 3.0 API for eBay
  11. as3exchangelibAn ActionScript library for talking to Exchange servers.
  12. as3facebooklibActionScript 3.0 API for Facebook
  13. as3fedexlibActionScript 3.0 library for accessing FedEx APIs.
  14. as3flexdbAS3FlexDB project is a open source lib that allows Adobe Flex applications to connect to a MySQL server

  15. as3flickrlibActionScript 3.0 API for Flickr
  16. as3gamelibActionScript 3 Game Lib
  17. as3isolibActionScript 3 Isometric Library
  18. as3libActionScript 3.0 standard library project
  19. as3mathlibFlex/Actionscript Math Library
  20. as3matrixA powerful Matrix Library built in Actionscript 3.0
  21. as3mp3streamplayerA library that allows you to play MP3 streams
  22. as3nativealertlibAn AIR alert that appears in a native window
  23. as3notificationlibA notification framework written in AS3 for the Adobe Integrated Runtime (AIR)
  24. as3plsreaderAn PLS (Playlist) reader for Adobe AIR / Actionscript 3
  25. as3powncelibActionScript 3.0 Library for Pownce full V2.0 implementation
  26. as3preferenceslibAn AIR library for storing preferences
  27. as3-rpclibActionscript 3 RPC libraries for flash-remoting(amf0), xml-rpc, json-rpc
  28. as3scribdlibActionScript 3.0 API for Scribd
  29. as3soundeditorlibActionscript 3.0 library for sound playback, spectrum display, and cue point display
  30. as3syndicationlibActionScript 3.0 library for handling syndication feeds.
  31. as3webserviceOpen-source Webservice class implementation in AS3 for Flash CS3 IDE.
  32. as3xlsRead and write Excel files in Flex
  33. as3youtubelibActionScript 3.0 API for YouTube
  34. ascolladaactionscript library for parsing Collada files
  35. asmailerActionscript 3 Mail API.
  36. assqlActionscript 3 MySql Driver
  37. assqliteutilsActionScript 3 SQLite utils
  38. beziercurvecreate and edit bezier curves on the fly, easy syntax
  39. benstucki

    – His open source as3 codes…

  40. bigroomActionscript 3 Source Code from Big Room
  41. birdeyeInformation Visualization and Visual Analytics Library
  42. braemarOpensource lightweight MVC framework for Flash development
  43. bulk-loaderA library for managing multiple loadings with Actionscript 3 (AS3).
  44. csvlibcsv parser for actionscript 3
  45. degrafaDegrafa is a declarative graphics framework for Flex.
  46. di-as3Dependency injection / Inversion of control container for ActionScript 3, Flash 9, and Flex 2
  47. displaylistmonitorMonitor Flash Display List
  48. efflexDesigner Effects for Flex
  49. everythingflexairlibeverythingflexairlib Library
  50. facebook-as3AS3 API to access Facebook’s Platform API
  51. fastas3 – ActionScript 3.0 Library for fast and fun development. FastAS3 is inspired by jQuery which is a new type of JavaScript library.
  52. flexfilteringControls and Collections for AS3 and Flex that support fast filtering across large datasets

  53. flexircclientActionScript 3 based IRC library
  54. flexwiresWires UI control library for Adobe Flex
  55. flexlibOpen Source Flex Component Library. I use this one often.
  56. flexstuffFlex stuff – Libraries and subprojects
  57. flexsurverylibraryCreate survey for Flex Applications
  58. flint-particle-systemActionscript 3 Particle System
  59. flvplayerliteA lightweight FLV player
  60. flvrecorderRecord BitmapData to an FLV-encoded file (for Adobe AIR)
  61. foam-as32D Rigid Body Physics Engine
  62. googleas3apiAS3 library on Googles Ajax API, search the web using Google in your Flash/Flex/AIR application
  63. icodecodericon file decoder
  64. lastfm-as3Actionscript 3.0 API to access the Last.fm web services
  65. masapiFlash/Flex/AIR AS3 Framework for the massive loading (MassLoad)
  66. metaphileA library for reading and writing file metadata in ActionScript 3
  67. minimalcomps – MinimalComps are a set of minimal user interface components for use in ActionScript 3.0 based projects.
  68. open-zoomOpen Source Framework for Multi-Scale Images and Zoomable User Interfaces (ZUI)
  69. opentubeA Flex Based Open Source Video Sharing Application
  70. pdfutilA simple AS3 library based on AlivePDF.
  71. popforgeActionScript 3 code sandbox for various packages
  72. queueloader-as3QueueLoader Actionscript 3.0
  73. redherringA light duty HTTP proxy for AS3
  74. reflexutilrun-time debugger for adobe flex components
  75. snackrSnackr, an RSS feed ticker for Windows/Mac/Linux built with Adobe AIR and Flex – http://snackr.net
  76. splinklibraryAn actionscript 3 library to ease the daily work
  77. splinkresourceAn actionscript 3 resource loading framework
  78. swfinjavascript toolkit for flash developers
  79. swizframeworkBrutally simple micro-architecture for Rich Internet Application development with Adobe Flex
  80. uicomponents-as3Lightweight AS3 UI component library
  81. urlkitFlex library providing a rule-based URL parser/generator for deep linking

Some Unit Testing Frameworks for the platform:

  1. as3flexunitlibActionScript 3.0 framework for unit testing. Its now moved tohttp://opensource.adobe.com/wiki/display/flexunit/
  2. flex-mojosFlex-mojos: Maven 2 plugins for Flex
  3. flexmonkeyFlex UI Testing Tool
  4. flexcoverCode Coverage Tool for Flex and AIR applications.
  5. fxspyInspect, edit and monitor your Flex application’s components properties and styles.
  6. FlexUnit – as3flexunitlibActionScript 3.0 framework for unit testing.

Non – goole hosted libraries:

  1. Sandy 3d engine – http://www.flashsandy.org/
  2. CASALib – Open source code library for Flex and AS3 projects. Read my review here
  3. Liquid Components for Flash
  4. FZip – FZip is an Actionscript 3 class library to load, modify and
    create standard ZIP archives.
  5. AlivePDF – ActionScript 3 Open-Source PDF Library
  6. ASSQL – Asql is a library for direct connections with Mysql, suitable for Flash CS3, AIR and Flex
  7. APE – ActionScript Physics Engine
  8. as3Query – Actionscript port of jQuery

AMF Remoting implementations

  1. FlourineFX – for .NET
  2. AMFPHP - Now giving way to ZendAMF
  3. ZendAMF

    – From Wade Arnold who made AMFPHP. Further development will only be in ZendAMF, so AMFPHP is kind of abandoned.

  4. PyAMF – AMF for Python

Assistive technologies:

  1. swfobjectSWFObject is an easy-to-use and standards-friendly method to embed Flash content, which utilizes one small JavaScript file
  2. SWFAddress – Deep linking for flex apps.

Some more links:

  1. List of 31 Flex APIs, Libraries, and components and tools by Sean Moore
  2. List of 21 AS3 API’s by Sean Moore
  3. AS3 Libs from EverythingFlex.com

Bon surf !


source: http://www.exagone.com/?p=92

Flex Component Basics

A Flex developer definitely need to know some methods while rendering Flex Components. Failing to use these methods will not update the UI. It is very necessary to know about these. I found this nicely explained information:

Here it goes:

This text covers the basics of how to implement the skeleton of a custom Flex component. There is a small code sample at the end of this text too.

The basic event and render "loop" in Flex consists of two steps:

  1. A user event occurs.
  2. The Flex application is re-rendered (if necessary).

A user event can be a button clicked, text typed into an input field, a browser re-size etc. A re-rendering is a re-drawing of the Flex application.

It is actually wrong to call it a "loop". The events and event processing take place independent of the rendering process. The Flex application rendering takes place no matter if an event occurs or not. A Flex appliation is re-rendered X times per second. That is, if any components in the application signal that they need to be re-rendered. If multiple events occur between two renderings, then the effects of all these events are batched up and rendered during the same rendering sequence. If no events occur between two rendering sequences, the rendering sequence is still executed, though the actual rendering may be optimized away.

The Flex (Flash) runtime doesn't know if it is necessary to re-render the application after a user event. Therefore you have to tell it so, by calling internal invalidation methods. These methods are inherited by your component from the mx.core.UIComponent superclass. During rendering the Flex (Flash) runtime will notice these invalidation method calls, and call some other corresponding methods, also inherited from the mx.core.UIComponent class. This text will describe in more detail how this works.


Implementing a Flex Component by Subclassing UIComponent

To create your own custom GUI components in Flex you extend the ActionScript classmx.core.UIComponent. This class has several protected methods that your component inherits. In this text we will look at the following methods:

  • invalidateSize()
  • invalidateProperties()
  • invalidateDisplayList()

  • commitProperties()
  • measure()
  • layoutChrome()
  • updateDisplayList()

The first 3 invalidation methods should not be implemented (overriden) by your component. Instead these methods should be called by your component internally, in response to user events. In other words, these methods are called during event processing.

In response to these invalidation method calls the Flex (Flash) runtime will call one or more of the 4 last methods. These methods should be implemented by you. Flex calls these methods during rendering. Therefore, multiple invalidation method calls may get collapsed into a single call to any of these 4 last methods.

All seven methods are covered in a bit more detail in the following sections.


User Events and Rendering of Flex Components

When the user of a Flex application takes action, like resizing a window, pressing a button, typing in some text etc. this may result in changes in your custom component. For instance:

User Event --> Change in size       of component            --> Change in looks      of compnonent            --> Change in properties of component            --> Change in children   of component            --> etc. 

The event may change either the size, the properties, or something else like a child of your custom component. Depending on what changes in your component, your component should internally call one of the listed inherited invalidation methods invalidateSize(),invalidateProperties(), or invalidateDisplayList(). Here is the call sequence of that:

User Event --> Change in size       of component                --> invalidateSize()             --> Change in properties of component                --> invalidateProperties()             --> Change of anything that needs the component                to be re-rendered                --> invalidateDisplayList() 

Calling one of these invalidation methods triggers calls during the next rendering of your Flex application, to the corresponding inherited methods mentioned in the beginning of this text. Here is how Flex determines what methods to call:

if(invalidateProperties() called) --> commitProperties();  if(invalidateSize() called)       --> measure();  if(invalidateDisplayList())       --> layoutChrome() +                                       updateDisplayList(); 

Note: The method invalidateDisplayList() method could get called by thecommitProperties() method too, as a result of calculations done there.

Now that you have an overview of the basic event and rendering loop, let's take a look at the four methods you will need to implement in order to implement your custom Flex component. In fact, you don't need to implement all four of them, as you will probably notice once you start implementing your own Flex components.


commitProperties()

The commitProperties() method is the first method called by the Flash runtime when it is ready to start drawing a Flex component.

If the given component has had any changes to any of its properties, like width, height, depth, color, or any other property, commitProperties() is where you do any necessary calculations based on these changed properties. If we did not have this commitProperties() method, you would have to make these calculcalations whenever any of the properties changed, to make sure they were indeed carried out. If more than one property is changed in between redrawing the component, that would lead to unnecessary repetition of these calculations.


layoutChrome()

The layoutChrome() method is used to define borders around your component, if you need this. Borders will be discussed in a later text.


measure()

In this method you calculate the size of the Flex component. This method is used to calculate:

  1. The minimum size of your component.
  2. The default size of your component.

If you set the width and height properties of a component then the measure() method does not get called. There is no need to, when the width is explicitly set. Only if the width is not explicitly set, is it necessary to calculate the size(s) of your component.

Sizing of Flex components will be discussed in more detail in a later text too.


updateDisplayList()

In this method you draw the component on the screen. To have this method called by the Flex runtime, you must have called the inherited method invalidateDisplayList() earlier. Only then is this method called.

Don't put drawing code anywhere else than inside this method, unless you are doing something special with animations, games etc.

The updateDisplayList() method also sets the actual sizes of any child components. This too will be covered in more detail in a later text.


A Flex Component Skeleton

Here is the code for a very simple Flex component. And below the code is how the component looks embedded in a web page. Here is the code:

package chart{      import mx.core.UIComponent;     import flash.geom.Matrix;     import flash.display.GradientType;     import flash.display.SpreadMethod;     import flash.display.InterpolationMethod;      public class Chart1 extends UIComponent {          internal var _barWidth : Number = 20;          internal var _value1 : Number = 50;          public function get value1() : Number {             return _value1;         }          public function set value1(value: Number) : void {             this._value1 = value;             invalidateProperties();             invalidateSize();             invalidateDisplayList();         }          override protected function measure() : void {             measuredHeight    = _value1;             measuredMinHeight = _value1;             measuredWidth     = _barWidth;             measuredMinWidth  = _barWidth;          }          override protected function updateDisplayList(             unscaledWidth:Number, unscaledHeight:Number):void {              super.updateDisplayList(unscaledWidth, unscaledHeight);              graphics.clear();             graphics.lineStyle(1, 0x000000, 1.0);              graphics.beginFill(0x00ff00, 1.0);              graphics.drawRect(0, 0, 20, _value1);          }     } } 

And here the component is used in a Flex application in MXML:

                                                                                           
Source: http://tutorials.jenkov.com/flex-components/component-basics.html

Monday, August 16, 2010

Communication between two flex applications or two swfs

The best way to go is to use LocalConnection. It allows you to call methods from a seperate SWF without having to go through Javascript or a server.

Tip: if you're going to be sending arguments that are greater than about 20KB in size, you will want to split them up in two or more calls. In my experience LocalConnection calls have a limit of around that size for data.

Thursday, August 12, 2010

Pros and Cons ( PureMVC - Cairngorm )

Here is a fantastic work done in comparing Cairngorm with PureMVC interms of pros & cons.

The best way described and awesomely presented.


Freelance