|
First up, Flex is doing more work for you than you realize
- the lastResult attribute has been marked with [Bindable] metadata which asks
the mxmlc compiler to generate some code to ensure that change events are
propagated to interested listeners. For a simplified explanation of what happens
in your particular case - when the asynchronous result event comes back
from the HTTPService it updates its lastResult property which in turn dispatches
a change event which, thanks to some code generated by the mxmlc compiler,
propagates this update to the dataProvider property of the
AreaChart.
Note the clues from the previous paragraph - results from
things like HTTPService or URLLoader are asynchronous so they too rely on you
dealing with events (specifically RPC result or fault events). You must
understand events and listeners if you want to achieve the same effect
manually.
You can use the ActionScript API for HTTPService yourself -
just import mx.rpc.http.HTTPService and instantiate an instance of the class
yourself and call send() just as you did on the equivalent MXML
component.
Alternatively, if you really do want to use URLLoader
directly then you'll have to add your own event listeners (see
flash.net.URLLoader.addEventListener) to listen for the "complete" event and
then set the AreaChart's data provider with the value of the URLLoader.data
property manually.
Finally, if you find something that could be improved
in the documentation the best way to help is to leave constructive criticism on
the live docs for the online version of Flex 2 manual.
Pete
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Sam Sent: Sunday, October 08, 2006 12:26 AM To: [email protected] Subject: [flexcoders] XML as a dataprovider Hi, -- 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
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 __,_._,___ |
- [flexcoders] XML as a dataprovider Sam
- RE: [flexcoders] XML as a dataprovider Peter Farland
- RE: [flexcoders] XML as a dataprovider Ely Greenfield
- RE: [flexcoders] XML as a dataprovider Ted Patrick

