I wrote AS3 code which allows you to search for videos from Youtube and parses the feedback and create objects. YoutubeService is the class which will do the parsing and creation of objects. It’s got three methods. One is the constructor, which will instantiate the HTTPService component. Second is the getVideos() method, this method will take the result handler and the search string as input.
You use these two methods to get the content from the Youtube server. Once the content is received you can send it to the createVideosFromXML() method to create objects of the type YoutubeVideo (AS Class). This method expects the XML response from the Youtube server as input in XML format.
All you have to do is to instantiate the YoutubeService class and call the method to create the YoutubeVideo object from the response as shown below
private function getVideos():void
var service:YoutubeService = new YoutubeService();
service.getVideos(handleServerResponse, <string to search for>);
private function handleServerResponse(event:ResultEvent):void
var responseXml:XML = event.result as XML;
var videos:ArrayCollection = YoutubeService.createVideosFromXML(responseXml);
That is all you need to do 🙂 download the YoutubeService Class and YoutubeVideo class at the URLs below.
Hope this is useful. Please feel free to use it. 🙂