views:

27

answers:

0

Hi guys... I am trying to build a as3 only search api project..

I am checking this guys's code here...

http://blog.martinlegris.com/2010/05/28/sample-code-using-the-youtube-as3-api-with-the-youtube-player-api/

He has following code...

protected function doSearchResults(evt:VideoFeedEvent):void
{
    if(_requestId == evt.requestId)
    {
        var feed:VideoFeed = evt.feed;
        _video = feed.getAt(2);
    }
    else
    {
        trace("this call:" + evt.requestId 
            + " isn't ours. We'll wait for the next one...");
    }

    if (_player != null)
    {
        startPlaying();
    }
}

and has an addEventListener

_ws = YouTubeFeedClient.getInstance();

_ws.addEventListener(VideoFeedEvent.VIDEO_DATA_RECEIVED, doSearchResults);
_requestId = _ws.getVideos("american idol", "", null, null, ["music"], ["male"],
    SearchOrder.ORDER_BY_VIEWCOUNT, SearchRacy.RACY_INCLUDE);

_ws.getVideos("music video");

I create a similar code in my project and my question is that doSearchResults has never been called...._ws has addEventListener but it has never received the event....I am not sure if I miss something here...Please help me about it...Thanks a lot!!!