let me rephrase you can do whatever but you need to listen for the 
ResultEvent.RESLUlT in actionScript and do
name.dataProvider = event.result


----- Original Message ----
From: Sherif Abdou <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Tuesday, February 12, 2008 12:38:43 PM
Subject: Re: [flexcoders] XML, HTTPSerivce, & Setting dataProvider in Action 
Script

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] com>
To: [EMAIL PROTECTED] ups.com
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 homepage. 



      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

Reply via email to