Arrays :: Flex Differences Between Array Collection Syntax
Dec 15, 2011I was wondering what's the difference between doing [code]However type 2 seems to work, but more people seem to reference type 1
View 1 RepliesI was wondering what's the difference between doing [code]However type 2 seems to work, but more people seem to reference type 1
View 1 RepliesI'm still struggling with memory-leak problems in the mega-project I talked about earlier (a children's fashion 'virtual showroom', where up to 600 videos and 3600 hires images can be viewed in one session).I'm monitoring memory use like this:
[AS]memory = Math.floor(System.totalMemory/(1024*1024)*100)/100;[/AS]
I cleaned up a lot of code, reusing objects whenever I can, and removing references (nulling) whenever I can, and I'm now at a point where memory usage is 'under control' on Windows machines, but not so on OSX machines.Results only vary slightly between various browsers on the Mac, and Firefox seems to perform the 'best'.The fact that there's such an obvious difference in memory leaking on Windows and on OSX, leads me to believe that my code is now okay, and that I'm hitting on differences in Garbage Collection-behaviour between the Windows Flash Player and the OSX Flash Player.Should I advice my client against the use of Macs (eventhough they just bought 60 MacBooks just to run this application on) because of this?
In my flex application im using two datagridfirst datgrid is for items collectionssecond is for bank details.if i click one row in first datagrid (which has the items collections)...a unique code is taken from the grid(which is primary key).then, i have to select two or more banks using itemrenderer checkboxes in second datagrid(which has the bank details)ow, have to bind the bank details(one or more banks) with that one primary key in first datagrid. to an single array collection... and have to show it in another new datagrid(thirdone)
View 1 RepliesI have an array, crewPositionsAC that contains a list of position abreviatations - EP, PR, DR, WR, and so on. These positions are read in through an XML file each time my flex application loads. Also being populated from an XML is a project. Within a project, there are positions (a student assigned to a type of position listed within crewPositionsAC). These positions are not necessarily in the correct hierarchy order dictated by crewPositionsAC. I have all the positions within an ArrayCollection (positionsAC) with the following structure:
positionsAC (arrayCollection)
[0] = Array
[0] = startOffset
[1] = numDays
[code].....
Then, the user can click a button to add another position. When the "Add Crew Member" button is pressed, the user is presented with a list of possible positions to add. Currently, I simply add another array to positionsAC. This results in the recently added crew member to placed on the bottom of the list. I need to take positionsAC and reorder it based on it's [2] item (role) based on the hierarchy defined in the crewPositionsAC. crewPositionsAC has the following structure:
crewPositionsAC:
[0] = EP
[1] = PR
[2] = DR
[3] = WR
* continue until all possible position types are listed
I have an array collection of strings and integers (which I have displayed in a data grid) and I am wondering if it is possible to export the array collection into an html table? or even a text file for the user to download
I found some pages that had an export to .xls files but I want to stray away from that for now.
While making my choice b/n Array and Arraycollection I get confused why whould I use one and why not another. I have read the theory in langref but apart from that is there some general advantages/disadvantages of one over the another that you have learned from your experience.
View 4 Repliesi have created one array collection in flex.and i have my one XML file. Now i want to call that XML file into arraycollection
View 2 RepliesIm trying to populate a tree control with an external xml file brought in via arraycollection but i need to group the xml data to display in the tree Okay my external xml file is called parts.xml and it looks like this:
[Code]...
additionally what i intend is for the user to have huge tree of parts and they select a node at the partnumber level and drag an drop it on to a datagrid where all the other tags of the part gets displayed.
Ive tried and tried many things without any luck. even now im thinking maybe if i looped through the array-collection and created a new array just for the tree to get it to display the way i need it, then when the user dragged and drop a part onto the grid i would have code that would look for that part number in the original arraycollection and add it to a new array just for the datagrid... i still dont know how i would create that new array for the tree!! cause the xml data is grouped by partgroup and then grouped again by parttype before you get the individual part numbers
Is it possible for me to filter only a certain column in a arraycollection but still displaying the other values in a datagrid?
View 1 RepliesI have an array collection that I would like to limit to say 100 items. I tried setting up a filter function where the return was:return (myAC.getItemIndex(item) > 100);but the value was always -1. For whatever reason it couldn't find the item, even though the item is definitely there.I'm able to do this with a while loop:while(myAC.length > 100) myAC.removeItemAt(100);
View 4 RepliesI have two xml files, defect. xml and employee.xml. But the files havea common field but with different names in each file. I want both the files to be merged in to a single array collection.
The structure of my defect.xml file is:
<defectList>
<defect>
<revId>123</revId>
[Code]....
Now, if I give datafield as "employeeId" in the datagrid with defectList as dataprovider, I get the employee id of the corresponding Employee Name.
I've got an XML Doc loaded in. I've created an Horizontal List and referenced the arraycollection as the Data Provider. But what I need to do now is then pull the data out from that. I have 3 nodes / variables. They are id, title, thumbnail. But when I go to pull through the data as : {videos.title} Flex Builder gives me the Error - "Access of undefined property videos". Now I know full well it exists, as when I set the dataProvider to {videos} it pulls through the data without issue.
My code is as follows :
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="[URL]"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="800" minHeight="600"
[Code] .....
How do I go about getting the XML Node : title and of course the thumbnail too?
Does flex allow empty, or missing, keys within an array collection? For example, would the following code be okay:
var myAC:ArrayCollection = new ArrayCollection;
myAC.addItemAt("hi", 0);
myAC.addItemAt("hola", 4);
[code]......
I have an array collection set as a datagrid's dataprovider. I'm pulling content from my relational database and 2 of the columns in the grid appear as foreign keys.
How do I go about replacing the foreign key id with information from the other table?
I'm guessing I need to do some sort of: for each, but I'm really not sure how.
I want to sort an array collection in a way that I am not sure is possible.Usually when you want to sort you have something like this.[code]if a is the same in multiple classes then I want to sort on ToSortInner2.aa Is this possible. I have tried to pass in inner1.aa as the sort field name but this does not work.
View 2 Replies[Code]...
I'm not getting like this ...how can I get groupId (exact id which I'm getting into arraycollection thru remoteobject) of selected GroupName?
In ActionScript I have string as
str="subject,r1,r2:a,b:1,2:3,4";
Dynamically I have split this string and build array collection as given below
arraycoll.addItem({subject:a ,r1:1,r2:3});
This example of one set. The array collection should be built dynamic. I have tried but not successful.
I'm using zend_amf and flex. My problem is i have to populate my advance datagrid using array collection. this array collection have a children.[code]...
View 1 RepliesI want to give an array index to array collection let say 205 when it is started is it possible to do so in flex or any alternate of this.actually I need to index the objects with a specific no, in 2D array collection
say
205 a c d g f d
268 s g h g f f
805 d g h h f f d
where integers are indexes and alphabets are object referenced by these integers
Is it possible to pass an ArrayCollection object from flex ExternalInterface.call() as a parameter to javascript function?
[Code]...
I am trying display values in a datagrid in my application. I have all the values as an xml file. I had only one set of record n the XML file, to fill only one row of the data grid. While trying to store the values from the XML file to an Array Collection in the application File using the code, i.e.,
<mx:Model id="reviewList" source="assets/reviewList.xml"/>
<mx:ArrayCollection id="reviewlist" source="{reviewList.Item}"/>
I get an error, saying Error No# 1034: Type coercion failed cannot convert mx.utils::ObjectProxy to Array.But If I have two record sets in the XML file, it works fine. If there is only one set, I gHere is my xml file:
<ReviewList>
<Item>
<ReviewId>1123</ReviewId>
[code]....
I have an array collection as the dataprovider to a datagrid. When I change a value in the arraycollection, a particular row gets updated in the datagrid. I want to get the index of that particular row. How do I get it?
View 1 RepliesI have an arrayCollection with the following structure:
[Code]...
the AC is defined as follows:[Bindable] private var projectErrorsAC:ArrayCollection = new ArrayCollection;
I'm using this AC in a repeater to display each error. After each error is shown, I've placed an "Accept" and "Deny" button. Once the user clicks either one of these buttons, I'd like to call a function that removes the particular error from the AC. Here's what I have so far:
[Code]...
I have a question about garbage collection in AS3. Let's say that I create a simple class, Item and link a movieclip in my library to this class. Now, in my main program, I create an array of Item's as follows:
Code:
var problemArray:Array = new Array();
function myTest()[code]....
Have the three references in the array that point to the three objects been deleted??? I made sure to set weak referencing on the event listeners that I attached, so I would think they would be marked for garbage collection. I am used to working in C++ so I usually delete all of the items myself and use a destructor in my classes, but since flash uses the garbage collection, I can't even seem to see what the reference count is to even know if my objects are marked for garbage collection. My thought is that an array is just a space in memory and if I set it to null, that space should be deleted, but I'm not sure if it is truly deleting these references or not.
I know that an ArrayCollection is a wrapper over an Array, but what I wanted to know is when to choose one over the other? Will the over usage of ArrayCollections result in performance?
View 1 RepliesI am attempting to build an array of arrays that will with the following syntax. My output is definitely not what I am trying to achieve. Here is my code:
[Code]...
My output is coming out as 6 references to "Set3". There is obviously something wrong with my for loops, but I can't figure it out.
I have a chart and am trying to display the "volume" in a line chart as the primary series & the "temp" as a column chart as the secondary series...(the "compound" will be shown in the datatip):
[{date=Tue Feb 08 19:00:00 EST 2011, volume=1200, 1={temp=-50, compound=helium}, 0={temp=-45, compound=oxygen}}]
I can get the "volume" series to display fine, but cannot get the "temp" series to display...how do I access them? Right now I have:
<mx:ColumnSeries id="secondSeries" xField="date" yField="temp">
I am running into some trouble adding an array into another array to create a multi-dimensional array.The code appears as below:
var slideDataArray:Array = new Array();
var slideShowDataArray:Array = new Array();
slideDataArray[0] = xmlData.SlideShowParameters.SlideShowImagesDirectory;[code]........
I am looking for a means of placing the slideDataArray into a 'slot' or value of slideShowDataArray so that I can in the end pass the slideShowDataArray as a parameter to another function.As of now, the last slideDataArray appears 11 times (the loop runs 11 times) in slideShowDataArray and the way the code is written the slideDataArray is unique every iteration of the loop.
Is there anyway where I can pass the Array values (not the array collection values) to the Bar charts or column charts using flex 3.5...
here is the thing i want:::
I have array values like this,,
array1 = [23, 49, 40, 239, 20, 80, 39,49,120, 24, 31,41];
and i want to show these values on the Yaxis and months on Xaxis....
I have two Qns,
1) how can I pass this array to Bar chart or column chart.
2) how do I need to show months on Xaxis. beacuse I'm asking this regarding, I have kept a filters that even if we want to see some months or a particular months or perticalar span of months... there on Xaxis it need to change the months dynamically depending on the filters..... (for ex, on Xaxis the values should be (Jan, Apr, Jun,Oct) if i select the 3 months period filter....)
I have written a logic to collect the values of those particular months into an array, but not understading how to pass this array to Bar chart,, beacuse there I don't know what Xfield and Yfield to be given....
LinkeSetFx has its own CollectionEvent, but I don't know how to map the LinkedSetFx event to mx.events.collectionEvent(I want use it in ComboBox). LinkedSetFx is in AS3Commons-collection framework.Here is the url, choose the as3commons-collections-1.0.0.zip, you'll find LinkedSetFx in srcorgas3commonscollectionsfx
View 1 Replies