title: Reading php generated XML in flash?
body: <p>Here is part 1 of our problem <a href="https://stackoverflow.com/questions/2390896/how-to-load-dynamically-generated-xml-file-as-php-in-flash">(Loading a dynamically generated XML file as PHP in Flash)</a>.</p>
  
  <p>Now we were able to get Flash to read the XML file, but we can only see the Flash render correctly when tested(test movie) from the actual Flash program. However, when we upload our files online to preview the Flash does not render correctly, missing some vital information(thumbnails, titles, video etc..).</p>
  
  <h2>Additional information:</h2>
  
  <p>The SWF file exists on Domain 1
  The XML &amp; PHP file both exists on Domain 2
  And the HTML file with the embed code lies on Domain 3</p>
  
  <p>Wondering if this could be a crossdomain issue? We have one of those files in place on Domain 1 &amp; 2 where we have access too, however for Domain 3 we can't have a crossdomain.xml file there.</p>
  
  <h2>Here is the PHP code:</h2>
  
  <pre><code>$xml = new XMLWriter();
  $xml-&gt;openMemory();
  $xml-&gt;setIndent(true);
  $xml-&gt;setIndentString("\t");
  $xml-&gt;startDocument();
  $xml-&gt;startElement('data');
  $xml-&gt;startElement('config');
      $xml-&gt;startElement('hex');
          $xml-&gt;writeCData('0x' . $widget_profile['background_color']);
      $xml-&gt;endElement();
      $xml-&gt;startElement('width');
          $xml-&gt;writeCData($widget_profile['width']);
      $xml-&gt;endElement();
      $xml-&gt;startElement('height');
          $xml-&gt;writeCData($widget_profile['height']);
      $xml-&gt;endElement();
      $xml-&gt;startElement('fullscreen');
          $xml-&gt;writeCData('false');
      $xml-&gt;endElement();
      $xml-&gt;startElement('special');
          $xml-&gt;writeCData('false');
      $xml-&gt;endElement();
      $xml-&gt;startElement('specialName');
          $xml-&gt;writeCData('Tools &amp; Offers');
      $xml-&gt;endElement();
      $xml-&gt;startElement('specialLink');
          $xml-&gt;writeCData('XXXXXX');
      $xml-&gt;endElement();
      $xml-&gt;startElement('client');
          $xml-&gt;writeCData($widget_profile['site_url']);
      $xml-&gt;endElement();
  $xml-&gt;endElement();
  
  if (count($widget_content) &gt; 0) {
      foreach ($widget_content as $tab) {
          $xml-&gt;startElement('tab');
          $xml-&gt;writeAttribute('id', $tab['tabname']);
  
          if (count($tab['video']) &gt; 0) {
              foreach ($tab['video'] as $video) { 
                  $video_sql = "select VID, flvdoname, title
                                from video 
                                where VID='" . $video . "'";
  
                  $video_result = $howdini-&gt;query($video_sql);
  
                  if ($video_result-&gt;rowCount() &gt; 0) {
                      foreach ($video_result as $video_row) {
  
                          $video_row['flvdoname'] = substr($video_row['flvdoname'], 35, -4);
  
                          $xml-&gt;startElement('vid');
                          $xml-&gt;writeAttribute('flv', $video_row['flvdoname']);
                          $xml-&gt;writeAttribute('thumb', 'XXXXXXXXX' . $video_row['VID'] . '.jpg');
                          $xml-&gt;writeAttribute('title', $video_row['title']);
                          $xml-&gt;endElement();
                      }
                  }
  
              }
          }
  
          $xml-&gt;endElement();
      }
  }
  $xml-&gt;endElement();
  $xml-&gt;endDocument();
  header('Content-Type: text/xml; charset=UTF-8');
  echo $xml-&gt;flush();
  </code></pre>
  
  <p>Thanks in advance for any answers! EDIT: I have included the change and now Firebug sees the XML. Now it's just not seeing the swf file but I can see the swf file in other parts of the page. </p>