coder and technology lover
Posts tagged flex
Populate a Flex’s ArrayCollection… a consideration about addItem() performance
Jan 12th
I’m playing with Flex data Providers and actually I’m testing ArrayCollection. There are 3 ways to populate an Array collection:
- Initialize an ArrayCollection and then use its addItem() method (which accepts any Object type)
- Initialize an ArrayCollection, access its “embedded” Array by using the source property (ie: myArrayCollection.source) an then push objects inside this one
- 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.
Choose and install multiple Flex SDKs for Flex Builder
Jan 4th
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:

Hello Flex, nice to meet you!
Nov 15th
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.
Adobe Flex 3 – Training from the Source… a new book to read :)
Nov 14th
Directly from Adobe’s Canadian headquarter and with the amazing efficiency of FedEx shipping (2 days only from Canada to Italy!), this morning I’ve received a new interesting and fresh book to read: “Adobe Flex 3 – Training from the source”… yes it talks about Flex 3, Actionscript and RIA and is part of an official books series from Adobe.
I would like to thanks Mike Potter, for the gift. I’ve appreciated it very much, and I hope to enter in the active Actionscript/Flex community as soon as possible.
Recent comments