ActionScript 3.0 :: ArrayCollection In Flash?
Apr 23, 2008Is it possible to use an ArrayCollection in Flash AS3? If so, how do I import? If not, should I just use an array? I'm loading an XML feed of mp3s.
View 3 RepliesIs it possible to use an ArrayCollection in Flash AS3? If so, how do I import? If not, should I just use an array? I'm loading an XML feed of mp3s.
View 3 RepliesI'm new to Flex and am using TileList bound to an ArrayCollection. The array collection is empty at load time, and then updates with the results from am HTTPService call. The problem is that the item renderers aren't being rendered as expected, I'm guessing because there was no data when they were first rendered at load time. Here's simplified example:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Script>
[code].....
I have a advanced datagrid and populating some data by using arraycollection. And i am filtering the arraycollection, the arraycollection index got changed.
Arraycollection:- [0] - name: abc
[1] - name: hello
[2] - name: hello1
[3] - name:hai
after filtering the arraycollection as 'hell' , the array collection is displaying like the below:
Arraycollection:-
[0] - name: hello1
[1] - name: hello
Can i know the reason why the index got changed after filter it?
* no server side code for filtering. it is only flex side filtering.
is there any way to use ArrayCollection (from mx.collections.*) in Flash CS3/4/5? How?
View 2 RepliesI heard that ArrayCollection on Flex, so how can I use ArrayCollection like feature in ActionScript 3.0 and Flash IDE.
View 2 RepliesFor example i have an ArrayCollection, and i want to find persons with telephone begines with "944" how can i do this?
[Code]....
My label text is not showing up after binding the arraycollection to the label text. Could I see an example of how to properly bind an arraycollection to a labels text?
View 2 RepliesI'm trying to set an array collection equal to a event.result that contains an array collection, but my array collection keeps coming up null. The event.result isn't empty because I can assign it as the dataprovider for a datagrid and that works (shows data correctly)[code]...
View 3 RepliesI am using Adobe Flash Builder 4 Premium. I have a mx:DataGrid and a s:TextInput, and I am trying to set up a search box that filters the DataGrid on each key press.his page shows a nearly perfect example of what I'm trying to do, except that I'm setting this up in a s:TitleWindow, which is brought up as a popup using the PopUpManager. The list I'm trying to filter can be very large. It is a list of usernames, fetched from a MySQL database via PHP. Since it can be so large, I want the list to be populated once in the main application and then referenced in the popup window so that it doesn't have to fetch all the usernames each time the user opens the popup.I have all of this working fine for the first time you bring up the popup, but if you close it and bring it up again, I get this runtime error:I also get this error if I attempt to set the filterFunction back to null just before closing the popup.See sample code below:
Main Application:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
[code]......
I know how to display data in a List control using dataProvider but what about control that don't have dataProvider e.g. TextInput, Label contorl?[code]Try to use {dp.ID} and {dp.getItemAt(0).ID} on TextInput but nothing being display?How to make TextInput id=" first Name" able to display the SQL data?
View 1 RepliesI am currently developing a mobile application using the latest version of Flash Builder and I need to create a Global ArrayCollection to store information in that is pulled from a local DB. I can pull back the data from the DB fine however I cannot seem to access the Global variable when I try. I have the follng .as file called "Model.as" which is located in a folder called valueObjects and that file contains the following code:
package valueObjects
{
import flash.data.SQLConnection;
[Code]....
Then in a private function I try to access the ids ArrayCollection and populate it however I get the following error:
-1120: Access of undefined property ids.
-Access of undefined property ids
I am using a service that returns JSON (geonames.org) and I'm putting the result in an array and dumping it to a datagrid. Now that works fine for one city like this [URL].. However, I want to call this service multiple times with different city names, so I created an XML list ad figured I would iterate over the city list and get the results.
My question is how do I do this such that 1) all the lists are combined into one arraycollection and 2) this seems like I will have to chain the calls and wait for results which may or may not come back, so I thought I would ask the group about the best practice, and or resources to read and examples to build from.
I am passing array collection from flex to web service, and now that array collection want to use in asp.net web service.
suppose i have passed one array collection, and based on that array collection i want fetch value from database and want to generate report and returning path to flex.
I'm using FlashBuilder 4 and trying to create a dropdownlist that populates a datagrid. The functionality is fine but my data is being chopped up too much. Currently every since "nepName" tag in my XML file is showing up in my dropdownlist (which makes for many duplicates of the same names) and only shows the data associated with that nepName tag. I want each nepName (by name ex. Barnegat Bay National Estuary Program) to display only once in my dropdownlist and populate my datadgrid with ALL the data in the XML file that is associated with that name.
View 2 RepliesIn Flex, it's easy to convert the XML to Object and to ArrayCollection by using var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(); decoder.decodeXML( xml );
But is there a good way to convert ArrayCollection to XML.
I currently have an arrayCollection in Flex and I want to sent it to PHP (Zend_AMF). According to the Zend_AMF wiki, sending an arrayCollection over directly will force Zend_AMF to cast the arrayCollection as an object which is no good. I'd rather have an array of my models. I assume the best way would be to convert the arrayCollection to an array in flex and then send it over. Is this true, and if so how would I do that in Flex 3? If you have a better recommendation,
View 1 RepliesIs there any way in Flex where in we can sort an arraycollection based on strings .I have a dataprovider with strings like "Critical" "High" "Medium" "Low" where in I need to sort it in such a way that I need Critical to be displayed on the top and next High , Medium and Low follows.
View 1 RepliesContext:
I use an ArrayCollection object as follows:
1) Number of elements is fixed.
2) Elements are inserted at a given position, based on some order.
Can I set the max size of the ArrayCollection? Will fixing the size improve the performance, as elements keep getting inserted into this collection?
I know this one might be easy but I couldn't figure out.I have a List control that retrieve multiply data from Mysql. When a use clicks the data on List, The datagrid will display the data and the product image will show.I can see the multiply data shown in my dataGrid, but I don't know how to get the individual data shown.
<s:List id="compList"
width="250"
height="350"
[code]........
In the resultHandler of an HTTPService call, I have assigned a repeating node to an arrayCollection. Inside that repeating node are other nodes that sometimes repeat and sometimes do not. For instance, here the option node repeats inside options.
<response>
<options>
<option> <var1> part1 </var1> <var2> part2 </var2> </option>
[code]....
I have an ArrayCollection with data; a trace of random index of this using
[code]...
I would like to create a new AC instance with a dynamic variable which is nca1, nca2, etc. Without define using hardcode variable name, it is possible to do that in a loop?
View 1 RepliesI trying to read a value from an ArrayCollection, I use getItemAt and get an object:
masterData.getItemAt(0,0)
Then i use: masterData.getItemAt(0,0).toString(); and get:
<d>
<i>The value that I need</i>
</d>
Now How can I get the value in "< i >" tag?
I have an XML file that I have imported into an ArrayCollection. I can get all child elements of the XML (ArrayCollection), but can't for the life of me get to the attribute. Where does the array collection put it?
View 2 RepliesI am having issues with this method. It's supposed to loop through stage elements (news feed) and check if the item is checked/enabled. If they are, it should add them into an array ratingAC, which will keep track of the number of elements that are rated, and the rating total. The problem I am having is that only one item is added to the total even if multiple are selected.
Archive Vars......
[Bindable]
public var newsDB:ArrayCollection = mx.core.Application.application.newsDB as ArrayCollection;
[Code]....
I need to create an arrayCollection as a copy of other arrayCollection. Then I need to change some data inside the copy, but when I do that the original arrayCollection changes as well. Is there a way to stop the changes in the original arrayCollection? For example I got: arrColOrig[0].someVar = 1
[Code]...
I am creating a RSS Feed application based on a data, and I have the following:
I have an ArrayCollection that is pre-populated with data. I am sorting through the ArrayCollection, get 1 piece of data (condition), and need to connect to an RSS feed which returns me the title, and I set my ArrayCollection in correspondence to condition -> title.
public function updateArrayList(list:ArrayCollection):ArrayCollection {
trace(list);
for(var i:int = 0; i < list.length; i++) {
//Alert.show(list.getItemAt(i).condition);
[Code]....
After applying a numeric sort to my dataprovider(Array Collection), I can not reorder the items via a tilelist. Do I need to remove the sort from the arrayCollection. If so, is it just a case of setting collection.sort = null ?
var sortField:SortField=new SortField();
sortField.name="order";
sortField.numeric=true;
var sort:Sort=new Sort();
sort.fields=[sortField];
I am trying to get the contents of an arraycollection to print out using my debug function (which takes a string). Anyone know how to do this? I would like it would be rather easy but can't seem to find a way...I get the word "Object" printed a lot of the time.
View 2 RepliesProblem with passing arraycollection to Advance datagrid. My Arraycollection structure like `
private var groupList:ArrayCollection = new ArrayCollection([
{Country:'India', children:[
{Country:'Series1', children:[
[Code].....
So if i tried to convert this format of xml code to arryacollection , it converted the array collection but when will i pass to Advance data grid it not show any result .
groupList1= convertXmlToArrayCollection(string1);
Alert.show(groupList1[0].Country[0].Matches[0].id.toString());// output is =701536