Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Flex ArrayCollection in FLex
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


bikrantsingh
ArrayCollection in FLex
1 Answer(s)      4 years and 3 months ago
Posted in : Flex


Hi...

please tell me about
What is the difference between ArrayCollection vs Array?
please give me ans ASAP......

Thanks


Advertisement
View Answers

October 20, 2010 at 1:03 PM


Ans:

ArrayCollection:

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.

For example:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" 
               minWidth="955" minHeight="600">
    <s:layout>
        <s:VerticalLayout/>
    </s:layout>
    <fx:Script>
        <![CDATA[
            private function gridinitialize():void {
                data.dataProvider = [
                    {aName:'Bikrant', DOB:'01/01/1986', 
                        City:'Delhi', State:'NewDelhi'},
                    {aName:'Brijesh', DOB:'15/07/1984', 
                        City:'Noida', State:'Uttar Pradesh'},
                    {aName:'Gaurav', DOB:'27/06/1989', 
                        City:'Mumbai', State:'Maharashtra'}                 
                ];
            }
        ]]>
    </fx:Script>
    <s:Panel title="DataGrid Control Example" width="428" height="409">
        <mx:DataGrid id="data" 
                     initialize="gridinitialize()" 
                     x="12" y="12" 
                     borderColor="#000000" 
                     borderStyle="solid" 
                     chromeColor="#000000" 
                     color="#90BB2A" 
                     fontFamily="verdana" 
                     fontGridFitType="pixel" 
                     symbolColor="#FFFFFF" 
                     textAlign="center"/>

    </s:Panel>  
</s:Application>

Array:

The Array class lets you access and manipulate arrays. Array indices are zero-based, which means that the first element in the array is [0], the second element is [1], and so on. To create an Array object, you use the new Array() constructor . Array() can also be invoked as a function. In addition, you can use the array access ([]) operator to initialize an array or access the elements of an array.

For example:

<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx">

    <fx:Script>
        <![CDATA[
            [Bindable]
            public var myArray:Array = ["Delhi", "Mumbai", "Chennai"]; 
        ]]>
    </fx:Script>

    <mx:ComboBox id="myCB0" dataProvider="{myArray}"/> 
</s:Application>


Related Tutorials/Questions & Answers:
ArrayCollection in FLex
ArrayCollection in FLex  Hi... please tell me about What is the difference between ArrayCollection vs Array? please give me ans ASAP...... Thanks
ArrayCollection in FLex
ArrayCollection in FLex  Hi....... I want to know about What collection change event gets fired when data changes in arrayCollection? please tell me the name of this event....... Thanks
Advertisements
ArrayCollection in FLex
ArrayCollection in FLex  Hi....... Difference between ArrayCollection and ListCollectionView? please tell me about this difference so i can clearly know which collection will be useful...... Thanks
Flex ArrayCollection
: #FFFFCC; } ArrayCollection provides more functionalities than an Array...(), removeAll() etc which makes ArrayCollection more useful rather than using Array. It also supports change listener that listens when arraycollection is updated
ArrayCollection in DataGrid
ArrayCollection in DataGrid  Hi.... I want to know about What are the advantages of using arraycollection as a dataprovider instead of array in DataGrid? please give the ans ASAP....... Thanks
Java and Flex
are the similarities between java and flex? Thanks  Ans:Java and flex both used as client application. The similarities between java and flex are following: 1. Both have pakages 2. OOPs concept 3. support XMl 4. support ArrayCollection
Referencing components in flex 4
in flex 4, while in 3 it worked correctly. Even in: arrTaxa=new ArrayCollection...Referencing components in flex 4  I used to create flex 3 applications using canvas as main components. In this moment I am creating flex 4
Flex 4
be accessed by indexing starting from 0.   Flex ArrayCollection...Flex 4 The Flex 4 is open source framework for building Rich Internet (RI) Application. In this section we will see the features of Flex 4. The Flex 4
Sitemap Adobe Flex Tutorial
| Flex Looping | Flex Arrays | Flex ArrayCollection HTML Tutorial... Introducing Flex | Downloading and Installing Flex | Downloading and Installing Flex Builder | Compiling MXML application | Eclipse flex ant
Flex Looping
Flex Looping  I need example for flex looping mechanisam example
Flex - Framework
Flex  database conectivity in flex
Flex Combobox
Flex Combobox  flex combobox with database as dataprovider   You can visit the following link for detailed tutorial on the topic. May this will be helpful to you. http://www.roseindia.net/flex/flex-combo-box.shtml
Flex event
Flex event  Hi.... Please tell me about How to create your own event in flex? Thanks
Flex and Java
Flex and Java  hi..... Please give similiarities between Java and Flex. Thanks
Flex basic
Flex basic  Hi...... please just tell me about Can we run Flex applications in MAC? Thanks
Flex and Java
Flex and Java  Hi.... What are the config files that are used to connect Java and Flex applications? Please provide the solution of this prob so i connect java and flex.... Thanks
Flex and Java
Flex and Java  Hi...... Give the name of Collection which can be mapped to java and Flex and vice-versa. please give the name of all collections which is used in flex and java.. Thanks
Flex basic
Flex basic  Hi.... Can flex application communicate with each other on the client? please give me the answer ASAP..... Thanks   Ans: See the LocalConnection API In the flex documentation. Thanks
Flex Updates
Flex Updates  Sir, first Thanks For Good Resource for Every One! i am New to Flex... but,in Current Updates Tell Us Flex Becomes To down!(Sorry To say).. May I know Future groom & Advantage of Flex Over Other Web
Flex as a Service
Flex as a Service  Hi....... just tell me about How do I run Flex as a service? please give me an example if possible Thanks  Ans: Flex is not a server. It is the pert of your web application. you can use
Flex basic
Flex basic  Hi.... I want to know Do we need any plugins to run Flex applications? please give the ans ASAP....... Thanks
Flex basic
Flex basic  Hi.......... I want to know about What is localToGlobal and globalToLocal in flex? please give me ans ASAP..... Thanks
Flex basic
Flex basic  Hi.... can you tell me about Is Flex OS specific or operating system independent? please give the description about it....... Thanks
Flex application
Flex application  Hi..... What kind of applications you can create from flex? please give the name of these applications....... Thanks
Flex difference
Flex difference  Hi.... please tell me about What is the difference between Flex 2.0 and Flex 3.0? Thanks  Ans: There are some advantages of Flex3.0 over Flex 2.0 they are following: 1. Faster compilation time
Flex with JSP
Flex with JSP  i want to draw chart in jsp page using flex. how can i do that? any solution??   Flex charts You can visit the following links: http://www.roseindia.net/tutorial/flex/flex4/components/charteffect.html
Flex basic
Flex basic  Hi...... Please tell me about What are non-visual components in flex? What class do they extend? please give the name of these components....... Thanks
Adding a flex table in another flex table column
Adding a flex table in another flex table column  how to add a flex table in another flex table column
Adobe flex
Adobe flex  Hi... please give me the description about What is Adobe Flex? Thanks
Mask in Flex
Mask in Flex  Hi...... Is it possible to create 'gradient mask' in flex? please give me the ans ASAP..... Thanks in advance
XML in flex
XML in flex  Hi... just tell me about What is e4X and XML in flex? Thanks
 

 

 

DMCA.com