title: XML-Youtube video in flash AS3
body: <p>I was making a player which calls videos from youtube.com and displays it in my flash playback component. The script loads the videos fine but when i want the flash to load the same video ID from an external XML data source, it loads the youtube player API but not the video. Here is the code</p>
  
  <pre><code>Security.allowDomain("www.youtube.com");
  Security.allowDomain("*");
  var my_player:Object;
  
  var my_loader:Loader = new Loader();
  my_loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
  my_loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
  
  function onLoaderInit(e:Event):void {
      addChild(my_loader);
      my_player = my_loader.content;
      my_player.addEventListener("onReady", onPlayerReady);
  }
  
  function onPlayerReady(e:Event):void {
      my_player.setSize(582.2,373.1);
      my_player.cueVideoById("53OyPYa7SEI",0);
      my_player.playVideo();
  
  }
  </code></pre>
  
  <p>This script loads the video from youtube.com with an specific ID which i have defined at </p>
  
  <pre><code>my_player.cueVideoById("53OyPYa7SEI",0)
  </code></pre>
  
  <p>later i defined and XML file called "videos.xml" where i passed the youtube link and tried to call the video from that xml file in flash. But the problem comes there. Here is the xml code</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
  &lt;videos&gt;
  &lt;VIDEO url="http://www.youtube.com/watch?v=53OyPYa7SEI" id=1/&gt;
  &lt;VIDEO url="http://www.youtube.com/watch?v=53OyPYa7SEI" id=2/&gt;
  &lt;/videos&gt;
  </code></pre>
  
  <p>Can anyone help me out to call the video from an XML file?</p>