Flex - Item's Depth In ArrayCollection?
Mar 21, 2010is it somehow possible to get item's depth in ArrayCollection?
View 3 Repliesis it somehow possible to get item's depth in ArrayCollection?
View 3 RepliesI have an ArrayCollection with values predefined. I want to assign a new value to items in the arrayCollection but can not figure out how. Basically I want to do something like this:acGuages.itemUpdated(0).thevalue = 90; (Changing the value from 25 to 90)
private var arrayGuages:Array=[
{thevalue:"25",height:"115"},
{thevalue:"45",height:"115"},
[code].....
I use a spark List with a custom item renderer and an ArrayCollection for dataProvider.
The ItemRenderer looks something like
<mx:TextInput id="txtValue1" text="{data.myFirstValue}"/>
<mx:TextInput id="txtValue2" text="{data.mySecondValue}"/>
However, even though I change the text in txtValue1 or txtValue2, those are not actually changed in the object inside the ArrayCollection.
myFirstValue and mySecondValue are decorated with the [Bindable] tag.
My understanding is that if the text property is set to be bound a certain property, the changes should be automatically applied.
So the HACK (or so I think) that I use is to listen to the focusOut event of each textbox, and access the parent data provider and set the the values manually.
I have some XML structures like this:
var struct:XML = <mh>
<mi id="1" stuff="whatever"/>
[Code]....
I wonder if items can be accessed in a similar way, like this:
var stuff:Object = cmenu['id == 2'].stuff;
I have an ArrayCollection where I want to be able to bubble items up or down by one position. What is the best way to do this?
View 2 Repliesi got an Arraycollection which holds other arrays in it.i want to display the data inside with an item render but cant manage to do this
here is example code to explain my question
<s:DataGroup dataProvider="{news}"
itemRenderer="components.displaynews">
and this is the item render
<s:Label text="{data.??/}"/>
now what i dont understand is what comes after data? in the array collection the data goes like this : myArrayCollection->[0]->firstname
so when im binding data to item render,how do i represent the [x] to get to the specific name that i want? this obviusly wont work
<s:Label text="{data.[0].name/}"/>
and one more thing is what is the lightest way to display data in a listgroup with simple item render (image and text)
private function convertFBEventData2TreeData(eventData:Object):Object
{
var children:ArrayCollection = new ArrayCollection();[code].....
i dont know what to add after data, i tried many things but nothing work :
Is there a way to reverse the order of the items in a comboBox? I'd like to use index numbers to refer to items in the arrayCollection below. I want the newest content to appear first in the comboBox. But, if I add something above the first item then all of the index numbers will be off by one. If I could add a new item to the end of the arrayCollection, but have it appear first in the comboBox drop down that would solve a lot of problems.
[Code]...
I 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?
Is there any way to move an item from one position in an ArrayCollection to another without removing and then adding it? There's no setItemIndex function in ArrayCollection, but there is a CollectionEventKind.MOVE that can be dispatched in a CollectionEvent. Does anyone know how to get ArrayCollection or any of it's cousins to dispatch that event?
I'm using the item as a dataprovider to a listy thing that implements effects, and I want the list to reuse the same ItemRenderer instead of creating a new one.
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].....
I am currently using the latest verion of Adobe Flash Builder to create a Mobile Application. For the application one feature is to allow the users to bookmark content an this is done by storing the id of the object to be Bookmarked into an SQLite db on the device. This part has been done successfully and they are stored fine.
Now what I want to do is to pull back the bookmarked id's from the database and pass them to a WebService call which needs to be made to an External Database. When I retrieve the Bookmark id's from the local database they are contained within object, I now need to find a way to take the id's from the database objects in the ArrayCollection and store them in a new array that will be passed to the WebService, as the webservice is expecting an Array of Int's and not Objects. Below is the code I created to see if the object items are within the array list of objects:
private function loop():void
{
var index:int;
[Code]....
I have this code to try to acess the values of the array in the arraycollection but it does not work it actually creates a value to the end of the arraycollection. can anyone tell me what im doing wrong i basically whant to modifys the individual arrays in the arraycollection and add Login_user.
Code:
for(var i:int = 0; i< dispArray.length; ++i){
dispArray.addItemAt({"login_user":"XXX"},i);
}
I have this datagrid:
<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149"
dataProvider="{colCompetente}" editable="false">
<mx:columns>
[Code]....
What I want to do is, when I select an item in the datagrid, the selected item of the dropdown should be the correct one (the one which has the field idCompSuperioara equal to the third element in the selected datagrid row).
I'm creating a mobile app in which I need to show a calendar with months at the top. The months are part of a component that extends from SkinnableDataContainer (and has some custom scrolling/behaviour - which is why I did'nt use a spark list). I need the months to be shown as a 'trapezium' shaped tab and so I'm using a png image as a mask in the item renderer for the component.
When the mask is not applied, it all works well - the months render, the list/data container selection works when I click on a month and so on.When the mask is applied, it renders well, scrolling and everything else seems to work well - but when I click on a month, nothing happens visually. And from the trace statements in my code, it appears list item selection is not changing. Looks like mouse clicks are not working.
Code:
public class TopCalendarMonthRenderer extends LabelItemRenderer {
[Embed(source="/assets/trapezium_alpha.png")]
private static var TrapeziumMask:Class;
private static var trapeziumMaskInstance:BitmapAsset;
[code]...
<mx:itemRenderer>
<mx:Component>
<mx:Canvas>
[code]......
I have used states in my application.The thing is I have made the first item in my list to be selected. so I gave like this,
if(itemIndex == 0)
this.currentState="selected";
this works fine.The problem is when other item is selected the first item does not change its state,it remains in the selected state until its clicked.My code looks like this,
<s:BorderContainer id="outerCont" width="275" height="100" borderVisible="false"
backgroundColor.normal="#3D3C3C" backgroundAlpha.selected="0.1"
backgroundColor.selected="{data.color}">
My states are like this,
<s:states>
<s:State name="normal" />
<s:State name="hovered" />[code]........
Is it possible to trigger Flex Piechart Item click event when a Datagrid Item is clicked.If so can anyone give some example.
View 3 RepliesI 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.
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]....
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>();
I'm trying to get the menu width of a menu item in flex 4. I can get it but I have to show the menu first, then hide the menu, do a calculation, and show it again. Is there an easier way to get the item menu width without this hassle?
View 1 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?
is there any way to use ArrayCollection (from mx.collections.*) in Flash CS3/4/5? How?
View 2 RepliesI 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'm adding a bg to the same canvas, but it's overlapping everything added before it.
View 2 Repliesputting a movieclip into highest depth without knowing which clip is in the highest depth
View 2 Replies