Mar 30, 2009

Difference between Array and ArrayCollection in ActionScript 3.0

Hi All,

Recently I got a query asking the difference between Array and ArrayCollection in ActionScript 3.0.

Let me draw quick comparison between Array and ArrayCollection:

  1. The elements of the ArrayCollection can be used in bindings that will be continued to be monitored. This is not the case with the normal Array class, once the element from an array is used in a binding, it is no longer monitored.
  2. ArrayCollection provides a rich set of tools for data manipulation


So what does all that mean?


According to the Adobe flex liveDocs

The ArrayCollection class is a wrapper class that exposes an Array as a collection that can be accessed and manipulated using the methods and properties of the ICollectionView or IList interfaces. Operations on a ArrayCollection instance modify the data source; for example, if you use the removeItemAt() method on an ArrayCollection, you remove the item from the underlying Array.


Let me take an example to clear this concept.

Say we receive some data through some webservice. Now if we parse the result set into Array, we have only a few tools to manipulate data namely, push() (for adding an element to the end), pop() (for removing the last element), length (the number of indices), etc.


However, the ArrayCollection class provides a suite of immensely convenient "extra" methods that can act on the Array namely the addItemAt(), removeItemAt(). So using these methods, we can directly access any index value of an array.


Apart from that, we can continuously watch the array for any changes at run time. Say, some user operation deletes a value from my ArrayCollection or Add a new item in my ArratyCollection which I am using as an dataProvider for a data grid. In that case, I can see the node getting disappear or visible at the same time.


This can’t be possible in the case of an Array.


This makes filtering of data as simple as eating a cake :)


HTH


Let me know if you have any doubt.


Thanks,

Shaleen Jain

Mar 25, 2009

Adobe® Flex™ Builder 3 Pro for Education.

Ad0be is providing free serials for flex builder for educational purpose

To receive the product, you must upload a valid proof of eligibility to get the serial numbers to activate the product. Valid proofs of eligibility are:

   1. a student ID showing current enrollment,
   2. a Faculty ID showing current employment
   3. an employee ID showing current employment, or
   4. a letter on an educational institution letterhead stating that you are either a current student,        a current faculty member or a current employee of the institution.

On the page that opens, accept the terms and click "Student"

On the next page, fill in all fields. There is a special field in this form: Student ID.They ask for a copy of a proof of registration or any document to prove their academic home. 
After uploading the image or PDF, click submit.

Now, Adobe will evaluate and, if approved, will send the serial via email within a maximum of 3 days.

To get the serial, Register with Adobe (the registration is free)

https://freeriatools.adobe.com/flex/

I got this piece of information from flex group and think of just spreading this through my blog so that community can take advantage of this.

Thanks,

Shaleen Jain