title: Calling a video from Youtube.com in Flash through an XML
body: <p>I am trying to call a video from youtube.com in flash as2. The video link is stored in a external xml file. Flash works fine when i try to call a video with an exact flv location but it crashes whenever i try to call a youtube url. I am stuck with the codes. I was wondering if the video can start at a specific GMT that needs to be stored in xml. Please help. </p>
  
  <p>Here is the flash code:</p>
  
  <pre><code>Security.allowDomain("www.youtube.com");
  Security.allowDomain("*");
  
  //initializing xml loading
  // load the xml file
  xmlData = new XML();
  xmlData.ignoreWhite = true;
  xmlData.onLoad = loadXML;
  xmlData.load("videos.xml");
  
  // parse the nodes of the xml into an array
  function loadXML() {
      vidArray = new Array();
      aNode = this.firstChild.childNodes;
      len = aNode.length;
      for (var n = 0; n != len; n++) {
          vidArray[n] = aNode[n].attributes.url;
      }
  }
  output_vid.onEnterFrame = function() {
      trace(vidArray[0]);
      output_vid.contentPath = vidArray[0];
  };
  </code></pre>
  
  <p>and here is the xml code (video.xml)</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=jYa1eI1hpDE"/&gt;
  &lt;/videos&gt;
  </code></pre>
  
  <p>Please help !!</p>