Hi everyone,
I saw in the documentation that one can't bind to elements of an arrays.
Indeed, it seems that something like label text={someArray[1]}/ does nothing.
I searched through the mailing list archive and made some tests myself, but couldn't find
something really simple.
- The first step seems to put :
someArray.replaceItemAt(1, item) instead of someArray[1] = item
The reason is that it will make someArray dispatch a modelChanged event.
- I tried several things, including using mx:Model or mx:Binding tags to make the linkage,
but then I doesn't work, and I couldn't find anyhting better than :
someArray.addEventListener(modelChanged, this);
With an event handling function that does the binding.
Although it is working, it looks a bit dirty. I hope there is some way to do it without any actionscript lines,
just like the other bindings.
- Here is a little example of something that I took as a starting example. What can be done to make it work ?
mx:Script
![CDATA[
var sourceArray = [ one, two, three ];
]]
/mx:Script
mx:TextInput id=sourceText text=Replace It ! /
mx:Button label=Update data click=sourceArray.replaceItemAt(1, sourceText.text); /
mx:Label text=sourceArray.getItemAt(1)='{ sourceArray.getItemAt(1) }' /
Thanks,
Damien
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Software development tool
Software development
Software development services
Home design software
Software development company
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group
|
Yahoo! Groups Terms of Use
|
Unsubscribe
__,_._,___