Jan 28 2009

Create custom reusable Flex’s components with Actionscript

Category: actionscript,flexDavide Zanotti @ 2:51 pm

I’ve played for a while with Flex’s library and now I’m experimenting my own custom components and I would like to share them and the knowledge necessary to build personal, reusable cool components.

Fundamentally there are two ways to realize custom Flex’s components: one (and the easiest) is to create an MXML file, the second is to create an Actionscript class.

Continue reading “Create custom reusable Flex’s components with Actionscript”

Tags: , , , , , ,


Jan 12 2009

Populate a Flex’s ArrayCollection… a consideration about addItem() performance

Category: flexDavide Zanotti @ 3:30 pm

I’m playing with Flex data Providers and actually I’m testing ArrayCollection. There are 3 ways to populate an Array collection:

  1. Initialize an ArrayCollection and then use its addItem() method (which accepts any Object type)
  2. Initialize an ArrayCollection, access its “embedded” Array by using the source property (ie: myArrayCollection.source) an then push objects inside this one
  3. Initialize an Array, populate it and then initialize an ArrayCollection by passing the Array to its constructor (ie: myArrayCollection:ArrayCollection = new ArrayCollection(myPreviousDefinedArray))

Last technique is (as far I saw) absolutely the fastest , I did a test in which I populated a collection with 300,000 objects and it taken about 9 seconds instead of 32 (350% slower) of first one! The second technique is also faster than the first, but the third is better.

So, what I learned is that addItem() should used only to add few items, instead for huge collection should be avoided in favor of the third technique described in order to obtain better performances.

Tags: , ,


Jan 04 2009

Choose and install multiple Flex SDKs for Flex Builder

Category: flexDavide Zanotti @ 3:47 pm

With Flex Builder is possible to install several SDKs (for example for testing purpose), all the SDKs are available here: http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK.
It’s possible for example to download the last SDK (still a preview) Flex 4 (codename Gumbo) and add it to the already installed SDKs, the procedure is really simple:

  • Download the zip file of the desired SDK (you have first to accept the license agreement)
  • Unzip it and rename the folder by leaving only the version number
  • Go to the installation folder of Flex Builder (which is in my case:  “/Applications/Adobe Flex Builder 3 Plug-in/”, because I’m using the Flex Builder plugin for Eclipse under Mac OS X)
  • Copy the zip content into the folder named “sdks”
  • Open Flex Builder and go to: Preferences / Flex / Installed Flex SDKs
  • Click on “Add…” button
  • Click on “Browse…” button and select the folder of the previously installed SDK
  • Flex Builder will automagically compiles the field “Flex SDK name” with “Flex 4.0″ (the name can be changed to whatever we like)
  • Now is possible to choose which SDK will be used by selecting its checkbox (in this case checkboxes are not an adequate choice, they should be radio buttons, because we can use only an SDK at time)

This is how the SDKs window looks on a Mac:

Adding a new Flex SDK

Tags: , , ,


Nov 15 2008

Hello Flex, nice to meet you!

Category: flexDavide Zanotti @ 9:27 pm

Today I’ve moved my first steps in the Flex world, following the introducing lessons of “Adobe Flex 3 – Training from the source”. After an introduction about RIAs, I’ve met Mr. Flex Builder and he told me about the fact that he has two faces, one for the source code and one for the visual design, and that he can switch among different perspectives (development, debugging and profiling)… then he showed me all his controls and layout components… he was so proud of them, but I told him that I can’t spend all the weekend to test their functionalities. So, I’ve took a look at how layouts work in Flex, and I’m very satisfied about the ability to draw dynamic areas that are able to resize and to be anchored to specific points.

Continue reading “Hello Flex, nice to meet you!”

Tags: , , , , ,


« Previous Page