lastResult doesnt work in Actionscript only MXML, you get null if you use it in
actionScript it should be just
private function initApp():void{
chartXML.send();
chartXML.addEventListener(ResultEvent.RESULT,onResult);
}
private function onResult(event:ResultEvent):void{
//u get event.result
}
----- Original Message ----
From: Brad Bueche <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, February 12, 2008 12:30:32 PM
Subject: [flexcoders] XML, HTTPSerivce, & Setting dataProvider in Action Script
I have been trying all morning to figure out how to set the dataprovider for a
line chart in actionscript.
Below is the code. The dataprovider in MXML works (and its the exact same
dataprovider! ). And if I put the statement back into the MXML for the
mx:LineChart it will work. Why wont this work in the actionscript?
************ ********* *********
Dataprovider in ActionScript
************ ********* *********
<mx:Script>
<![CDATA[
[...{
switch(lineOfBusine ss)
{
case "ABC":
chartXML.url= "http://hostname/Data/xmlData_
ALL_ABC_12Months_All_ Days_2007. php";
chartXML.send( );
[....]
line_Chart.dataProv ider = chartXML.lastResult
.month[month_ number].day;
[....}
</mx:Script>
<mx:HTTPService id="chartXML" resultFormat= "e4x" showBusyCursor= "true" />
<mx:LineChart id="line_Chart"
width="932" height="309" x="23" y="10" showDataTips= "true" >
<mx:horizontalAxis>
<mx:CategoryAxis id="cat1" dataProvider= "{chartXML.lastResult
.month[month_ number].day}"
categoryField= "{categoryFieldString}" title="{categoryAxisTitleSt
ring}" />
</mx:horizontalAxis>
</mx:LineChart>
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs