0 Replies Latest reply on Aug 8, 2010 6:19 PM by jerry98225

    Actionscript 3 - Youtube API questions......

    jerry98225 Level 1

      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-you tube-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 addEventListenr but it has never received the event....I am not sure if I miss something here...Please help me about it...Thanks a lot!!!