ActionScript 3.0 :: Move An Item Within An ArrayCollection?
Oct 18, 2010
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.
View 0 Replies
Similar Posts:
Jul 18, 2011
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?
View 2 Replies
Mar 21, 2010
is it somehow possible to get item's depth in ArrayCollection?
View 3 Replies
Nov 27, 2009
I 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].....
View 1 Replies
Jun 16, 2011
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.
View 1 Replies
Oct 14, 2009
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;
View 8 Replies
Mar 22, 2010
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 Replies
Jul 27, 2011
i 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 :
View 1 Replies
Aug 26, 2011
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]....
View 1 Replies
Jan 26, 2011
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]...
View 1 Replies
Aug 24, 2010
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);
}
View 1 Replies
Jun 27, 2011
My items no longer sit on top of the gray area outside the stage. When I try to move an item off the stage it goes under and I cant see it.I am using cs 5.5. I think I must have changed an option somewhere, becuase if I open up a new document everything is fine.
View 1 Replies
Mar 9, 2010
I have a tree control and I want to give the user the ability that he can move up and down the element he just selected with a up and a downbutton. The tree gets generated from XML. I managed to insert the selected item a second time at a other place, with the following code:
var parentXML:XML = XML(containerTree.selectedItem).parent();
var upperItem:XML = topContainer.source[containerTree.selectedIndex-1];
parentXML.insertChildBefore(upperItem,XML(containerTree.selectedItem));
but then I have the item there twice in the List. How can I remove to reinsert it?
View 1 Replies
Jun 2, 2010
i want to make my thumbnails move opposite of where the mouse is. so for example, if i move the mouse up the thumbnail moves down, if i move the mouse left, the thumbnail goes right etc...
im trying to google this but i dont even know what its called so im not getting good results, or rather TOO many varied results lol.
what this function is called?
View 14 Replies
Jan 16, 2010
I've got a movie with a "next" button. The movie is approximately 1330 px wide. The "next" button needs to move left and right within that width as the browser window is resized. For instance, the browser window starts at greater than 1330px wide so the "next" button is at the far right edge of the movie. The user then resizes the browser down to 800px wide. The "next" button needs to move left to 800px. The entire movie can't resize, only the "next" button in that movie must move.
Here's a link the movie as it currently is. The "next" button shows up after the 2nd click in the sequence. It's the brown arrow on the right. http:[url].....
View 5 Replies
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
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
Nov 21, 2011
Let me ask how to program an html page to move to a new web page on user's clicking an item of an embedded flash movie? But , in detail, I actually want to do a little different thing. I want that the parent html page remains there ,instead I want a child html frame has a new page after user's clicking the list item of the embedded flash movie.
View 2 Replies
Feb 15, 2011
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).
View 1 Replies
Jun 10, 2011
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]...
View 1 Replies
Jul 20, 2010
I am in search of finding a way to display shopping cart items in a flash 8 datagrid in the order it was chosen by the user & also to ability to delete an item if the user choses. Currently I have the items displaying however they are displaying in a position as it is stored and called in the array. [code]
View 5 Replies
Jul 22, 2011
I have made a drop down menu with 7 items but as the invisible bottun around each item interferes with the item besid it, when i try to roll the mouse from one item to another, the invisible bottum dont work and the dropdown remains open.
View 1 Replies
Mar 4, 2011
<mx:itemRenderer>
<mx:Component>
<mx:Canvas>
[code]......
View 2 Replies
Apr 26, 2011
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]........
View 1 Replies
Nov 4, 2011
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 Replies
Jul 13, 2009
I want to be able to select an item from my list component and fire a function directly related to selecting that item. list is called "tidlist" function is "selecttid(n)" the "n" needs to be replaced with the index number... so if run my swf and the list component displays my items... when i select one (the third one for example)... i want to fire "selectTid(3)".... cant seem to grasp.
View 1 Replies
Jul 13, 2009
I want to be able to select an item from my list component and fire a function directly related to selecting that item.
list is called "tidlist"
function is "selecttid(n)"
the "n" needs to be replaced with the index number... so if run my swf and the list component displays my items... when i select an item (the third one for example)... i want to fire "selectTid(3)".... cant seem to grasp.
View 1 Replies
Oct 30, 2005
Im doing my platform game and I want to know in ActionScript how to get a character to pick up an item and throw the same item.
how do I do that? whats the code?
View 1 Replies
Mar 10, 2011
How to show the item index in my item renderer.Owner of the item renderer is TileList. [url],..
View 2 Replies
Jan 2, 2010
If I have several items that move across the screen but the user can click any of them at any time, how do I record the current position of any of the items item in order to use that data to change the position of the item after the user clicks?
This is what I am doing: I have 11 images that slide accross the screen. The user can click any of them at any time. When he clicks one I am scaling the image so it looks like it is comming forward (z axis) and then the rest of the images are scaled down so it looks like they are going back on z axis. So what I am trying to do is get the current position of the image when the user clicks the image so that I can use that to correctly estimate the scaling and moving of the image to make it look like it scales from the center and not from the top left corner. So if have a variable that gets the current position of the image being clicked I'm thinking I can change its position using something like: x = currentposition + -45;
View 9 Replies