Flex :: Specify Size For An Arraycollection?

Mar 12, 2010

Context:

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?

View 1 Replies


Similar Posts:


Flex :: How To Get Memory Size Of ArrayCollection

Feb 2, 2010

I have built an image cache which is an ArrayCollection containing images. I have built functionality so that the cache can hold a max of 250 images. However, the images can be of a different size, so it's better to limit the total memory size of all images in the ArrayCollection. How I can get the total memory size of an ArrayCollection without looping through all the items in the ArrayCollection?

View 1 Replies

Flex :: ArrayCollection - List With Texts Of Different Size

May 14, 2011

I have an ArrayCollection named authors with lot of texts of different size. I would like to list all info about authors in a way that each item has a size according to the text.
Here is the code:
<mx:List dataProvider="{authors}">
<mx:itemRenderer><mx:Component>
<mx:VBox width="100%">
<mx:Text text="{data.name}"/>
<mx:Text text="{data.about}" width="100%"/>
</mx:VBox></mx:Component>
</mx:itemRenderer></mx:List>

View 2 Replies

Flex :: Mxml - Components Bound To Empty ArrayCollection At Load Time Don't Render As Expected When The ArrayCollection Is Updated?

Oct 27, 2009

I'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].....

View 2 Replies

Actionscript 3 :: ArrayCollection Index Got Changed After Filter The Arraycollection?

Oct 7, 2011

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.

View 2 Replies

Flex :: Datagrid - ItemRenderer Flex Values Getting Not Rendered According To ArrayCollection Provider?

Feb 4, 2011

i have a problem using the itemRenderer functionality. When using an ArrayCollection the visible Data in the DataGrid using the itemRenderer will be rendered just fine. But if i start scrolling the entries are repeating in the cells using the renderer. The cells are not filled with date according to the id. What mistake i'm doing here.

I read a lot of the explainations like:

[URL]

here is the code for the set data function (itemRenderer is extending HBox):

override public function set data(value:Object):void {
_data = value;
if(data!=null)

[code]....

View 1 Replies

Flex :: ArrayCollection Versus Vector Objects In FLEX?

Apr 20, 2010

the applicable differences between an ArrayCollection and a Vector in flex? I'm unsure if I should be using one over the other. I saw that Vector is type safe and that makes me feel better, but are there disadvantages?

public var ac:ArrayCollection = new ArrayCollection();
versus
public var vec:Vector.<String> = new Vector.<String>();

View 4 Replies

Flex :: Convert ArrayCollection To XML?

Jul 24, 2009

In 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.

View 3 Replies

Php :: Zend_AMF: Get A ArrayCollection From Flex?

Sep 22, 2009

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 Replies

Flex :: Sorting An ArrayCollection?

Oct 21, 2009

Is 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 Replies

Flex :: Use ArrayCollection In Flash CS5?

Dec 2, 2010

is there any way to use ArrayCollection (from mx.collections.*) in Flash CS3/4/5? How?

View 2 Replies

Flex :: ArrayCollection GetItemIndex Always -1

Mar 1, 2011

I have an ArrayCollection with data; a trace of random index of this using

[code]...

View 2 Replies

Flex :: Create Arraycollection With Different Name?

May 14, 2011

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 Replies

Flash :: Flex Relative Size Component, Fixed Size Border?

Mar 3, 2011

I want to create a panel (or any other component) inside a component that has a 5 pixel border on all sides, but scales fully when the window is resized. I know I can set width to "100%" to make it resize, but that gives me no borders. If I put it to "95%",I have borders, but they scale annoyingly. Also, that only works for borders on the right or lower bounds, and not to the left or upper sides.Is there a convenient way to do this without having to write tons of resize-code (in which case I will not bother and just accept bad rescale behaviour, as it is for a private pet project).

EDIT: I know that I can just overwrite the display handling and set the positions manually every frame. I wondered if there is a cheap way to do it in the mxml-structure, along these lines:

<mx:Panel>
width="100%" height="100%"
</mx:Panel>

Coming from C++ and Java, I am intrigued by the option of setting something to "95%" and let the library work out the details, instead of having to write many lines of code, just so my text-area always keeps a 5 pixel distance from the border, but scales with window width.If there is no easier way to do it than figuring out pixel sizes by hand and setting the coordinates.

View 1 Replies

Flex :: Change Radiobutton Size And Label Size In Actionscript?

Aug 10, 2010

I am trying to change my radiobutton size and label size in pure as3...

searchRB = new RadioButton();
searchRB.name = "search";
searchRB.group = rbg;

[Code]....

View 1 Replies

Flex :: Changing Image Size Independent Of Scene Size?

Apr 6, 2011

I have three images and I want change the images size based on the scene size (default size is 1024x768). After each image has completely loaded I call bindableUtils.setter to set width/height when scene size changes but I don't know how to make a pointer or something like that. I'm using a public var img, but it only works with the last complete image.

Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

[code].......

View 2 Replies

Flex :: Populating ArrayCollection With HTTPService?

Jul 14, 2009

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]....

View 1 Replies

Flex :: ArrayCollection Removing Sort?

Aug 3, 2009

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];

View 3 Replies

Flex :: Get Contents Of Arraycollection As String?

Aug 6, 2009

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 Replies

Flex :: Populate ArrayCollection With HTTPService?

Nov 11, 2009

I want to load data from a external XML file, using a HTTPService, and on the ResultEvent of the same HTTPService i want him to populate a ArrayCollection with the data from the XML.

I think a ArrayCollection is the ideal for this XML.

XML

<?xml version="1.0" encoding="utf-8"?>
<PhotoGalleryData>
<Photo>

[Code].....

View 2 Replies

Flex :: AdvancedDataGridRendererProvider ChildrenField ArrayCollection?

Feb 5, 2010

I have a main class ClassA that has a bunch of "normal" properties that are simple datatype like ints, strings, etc. It also has one property ("childItems") that is an ArrayCollection of ClassB.I am using an ArrayCollection of ClassA as the source for an hierarchical data provider for an AdvancedDataGrid. I set the childrenField to "childItems".

I want to display some information about the list of ClassB objects in a nested table and pie chart, an AdvancedDataGridItemRendererProvider (columnIndex = 0, columnSpan = 0, depth = 2) and point it to my custom renderer which is an HBox with the table and the pie chart in it.

In order to see what is being set, I override the "set data" function in my custom renderer and what I see is that each instance of ClassB in the ArrayCollection is passed to the renderer separately.

Here is my question: I expected the whole ArrayCollection of ClassB instances to be passed to the custom renderprovider once and not each item in the child list individually. How do I make the ADG understand that the whole property is supposed to be passed as the data to the renderer and not each entry separately? Btw, when I change the data type of "childItems" from ArrayCollection to ArrayList, the whole list gets passed and I can easily do what I want to do. But based on my understanding, ArrayList is not really supposed to be used and ArrayCollection is better or at least more common.

View 1 Replies

Flex :: Getting Unique Elements From An ArrayCollection?

Mar 19, 2010

I have an ArrayCollection as mentioned below.

private var initDG:ArrayCollection = new ArrayCollection([
{fact: "Order #2314", appName: "AA"},
{fact: "Order #2315", appName: "BB"}[code].....

I want to populate a ComboBox with UNIQUE VALUES of "appName" field from the ArrayCollection initDG.

<mx:ComboBox id="appCombo" dataProvider="{initDG}" labelField="appName"/>

One method I could think is to loop through the Array objects and for each object check and push unique appName entries into another Array. Is there any better solution available?

View 4 Replies

Flex - Item's Depth In ArrayCollection?

Mar 21, 2010

is it somehow possible to get item's depth in ArrayCollection?

View 3 Replies

Flex :: Binding Applies Only To One ArrayCollection?

Apr 15, 2010

I have a datagrid that gets its data from a webservice.When data from the webservice is retrived it calls the following function:

private function onListReg():void
{
arrRegOld = WSAutoreg.list.lastResult as ArrayCollection;
arrReg = WSAutoreg.list.lastResult as ArrayCollection;

[code].....

The intent is when I hit a update button, it compares arrRegOld with arrReg and see if any values have changes. The problem is whenever I change values on the Datagrid it changes on both the dataProvider and on both ArrayCollections.What should I do so that the binding applies only to one ArrayCollection?

View 1 Replies

Flex :: Binding To Arraycollection Does Not Work?

May 23, 2010

I am using flex SDK 3.5. I have model.as and in it i have an ArrayCollection (name it arr_mod) which is Bindable.

From my mxml i link to this arr_mod in three places:
1) in DataGrid i set dataprovider={arr_mode} ...

2) in Button i add new item to the arr_mod this way: mx:Button .. click = "{arr_mod.addItem(new Item)}"

3) in textBox i want to add mx:TextBox text="{mySpecialCounterFunc(arr_mod)}"
note that in the Script of mxml arr_mod is Bindable as well as in the class definition in model.as

The problem is, that when clicking on button, mySpecialCounterFunc is not called! it should be called, since i use {} and this should listen to changes in arr_mod (a change that was made in the button should cause a new item to be added.. and than the listener to respond). While The DataGrid is updated correctly! By the way, if i change arr_mod to simple String or Int it works.. i.e. mySpecialCounterFunc is called Why??

View 1 Replies

Flex - To Change Xml Data To ArrayCollection?

Jun 3, 2010

I have xml file with data as below and i want to convert this into Flex ArrayCollection including the id and name of the tags. I am using httpService to get the file.

[Code]...

View 1 Replies

Xml :: Flex - ArrayCollection To XML Conversion Without SimpleXMLEncoder

Aug 20, 2010

Here are my functions for conversion:

[Code]....

Question: How can I solve this and is there a bug in the API? PS: I admit the code isn't straight forward because it simply didn't work. PPS: SimpleXMLEncoder throws stack overflow if I have objects that have a property value referencing to other objects... so that's why I want to write my own method for the conversion

View 1 Replies

Flex :: ArrayCollection - Selecting Value From ComboBox

Sep 22, 2010

My goal is to create a generic function that selects a value in a combobox according to a value. (My comoBox holds arrayCollection as dataProvider.) The difficulty is infact to get a propertyname in runtime mode.

public function selectComboByLabel(combo:ComboBox , propetryName:String, value:String):void {
var dp:ArrayCollection = combo.dataProvider as ArrayCollection;
for (var i:int=0;i<dp.length;i++) {
if (dp.getItemAt(i).propertyName==value) {
combo.selectedIndex = i;
return;
}}}

The line if (dp.getItemAt(i).propertyName==value) is of course incorrect.
It should be arther something like: dp.getItemAt(i).getPropertyByName(propertyName)

View 2 Replies

Flex :: Swap Two Items In An ArrayCollection

Oct 11, 2010

I am trying to swap two items in an ArrayCollection with this code.

[Code]...

When debugging the code I can see that curItem and swapItem are the correct objects, but when I do my first setItemAt, it replaces the one I wanted but also one that I didnt want.

View 1 Replies

Flex :: Getting DataFields Of DataGridColumn Into ArrayCollection?

Nov 9, 2010

I have a DataGrid with 3 DataGridColumns. All 3 of them have separate dataFields.I need to get the datafields into an ArrayCollection and pass it to a funciton. I dont want to hard code the ArrayCollection.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved