Mega Code Archive
Extract the data from the HTML page by using regular expressions
import mx.events.FlexEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
[Bindable]
public var chartData:XMLList;
private function initApp():void {
serviceInput.addEventListener(ResultEvent.RESULT, resultHandler);
serviceInput.addEventListener(FaultEvent.FAULT, faultHandler);
serviceInput.send();
}
public function resultHandler(evt:Event):void {
// Extract the XML data from the HTML page.
var htmlBlob:String = serviceInput.lastResult.toString();
htmlBlob = htmlBlob.slice( htmlBlob.indexOf("", 0) +25, htmlBlob.length );
htmlBlob = htmlBlob.slice( 0, htmlBlob.indexOf("", 0) );
// Create an XMLList from the extracted XML data.
chartData = new XMLList(htmlBlob);
}
public function faultHandler(evt:Event):void {
trace(evt.toString());
}