1
我試圖從imdb獲取數據到as3。我試過如下:從imdb獲取數據
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, urlCompleteHandler);
urlLoader.load(new URLRequest("http://www.imdbapi.com/?t=The+Green+Mile "));
private function urlCompleteHandler(e:Event):void {
var resultXML:XML = new XML(e.target.data);
trace(resultXML);
}
現在,如果我跟蹤resultXML我得到:
{"Title":"The Green Mile","Year":"1999","Rated":"R","Released":"10 Dec 1999","Genre":"Crime, Drama, Fantasy, Mystery","Director":"Frank Darabont","Writer":"Stephen King, Frank Darabont","Actors":"Tom Hanks, Michael Clarke Duncan, David Morse, Bonnie Hunt","Plot":"The story about the lives of guards on death row leading up to the execution of black man accused of child murder & rape, who has the power of faith healing.","Poster":"http://ia.media-imdb.com/images/M/MV5BMTUxMzQyNjA5MF5BMl5BanBnXkFtZTYwOTU2NTY3._V1._SX320.jpg","Runtime":"3 hrs 9 mins","Rating":"8.4","Votes":"214654","ID":"tt0120689","Response":"True"}
現在我試圖從這個結果得到了「等級」,但我不知道如何得到它。
我試過了:resultXML.Rating
但這不會返回任何結果。
任何knw如何我可以得到評級?