Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
Pratap Reddy #1
How to update ArrayCollection at runtime?
Am facing some problem with arraycollection..
am having an arraycolelction like this...
var dpHierarchy:ArrayCollection = new ArrayCollection([
{Region:"Demand1"},
{Region:"Demand2"},
{Region:"Demand3"},
{Region:"Demand4"}]
now what am looking for is.. how to update this arraycollection at runtime
using actions script?
i need to update this array colelction something like this...
var dpHierarchy:ArrayCollection = new ArrayCollection([
{Region:"Demand1", Year:"2008"},
{Region:"Demand2", Year:"2008"},
{Region:"Demand3", Year:"2008"},
{Region:"Demand4", Year:"2008"}]
How to add Year field in to existing arraycollection like shown in about
example..
thanks in advance
Pratap
Pratap Reddy Guest
-
How to update the ItemRenderer at runtime..?
Hi.... am facing a hectic problem with ITemRenderes.. My requirement is like i need to insert a Label and Image in each item of Horizontal List.... -
ArrayCollection to XML
I have data in an ArrayCollection. I need to post the data to a web page for saving on the server. It seems the best way to do this is to convert... -
ArrayCollection
How to navigate and get values of ArrayCollection? -
How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the datagrid Update event.
How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the... -
using external cast to update content at runtime from a projector or shocked piece
Hello List People: I am trying to create a projector (or shocked piece) that will use content from an external castLib so that I don't have to... -
Greg Lafrance #2
Re: How to update ArrayCollection at runtime?
How about have the ArrayCollection based on an Array, but add a dimension to the array to accomplish what you want.
Greg Lafrance Guest
-
Pratap Reddy #3
Re: How to update ArrayCollection at runtime?
hi,,
thanks for reply...
can u help me to give some example how to do that?
thanks in advance
Pratap Reddy Guest
-
Kaotic101 #4
Re: How to update ArrayCollection at runtime?
There are two ways you can do this. One would be setting it straight like this.
private function updateDP():void {
dpHierarchy[0].Year = "2008";
}
This will also make it so that every other item in your ArrayCollection has
the Year identifier however nothing will be filled in for the values. The other
way you could do this would be to user setItemAt which would look like this.
dpHierarchy.setItemAt({Region:"Demand1", Year:"2008"}, 0);
which essentially does the exact same thing except your setting all the
properties of that item instead of just adding the identifier Year.
Kaotic101 Guest
-
Pratap Reddy #5
Re: How to update ArrayCollection at runtime?
hi.. s this works fine..
Any idea how to make item name dynamic..
something like..
private function updateDP():void {
for(var i:int=0;i<10;i++)
{
dpHierarchy[0].Year = "2008"; /// How to add that 'i' value over here?
}
}
i wanna add Year1, Year2, Year3 --------- like this...
is its possible??
thanks in Advance
PRatap
Pratap Reddy Guest
-
Pratap Reddy #6
Re: How to update ArrayCollection at runtime?
hey got it...
just i need to give
dpHierarchy[0]["Year"] = "2008";
:-)
Pratap Reddy Guest



Reply With Quote

