MySQL --> PHP --> XML --> FLASH

  • frons
  • Born
  • Born
  • No Avatar
  • Joined: Sep 14, 2007
  • Posts: 3
  • Loc: Ancona, ITALY
  • Status: Offline

Post November 7th, 2007, 1:40 pm

Hello everyone, I've wrote 1 php page that transforms a normal query to a db into a standard xml file, ready to be forwarded to a Flash file.

The PHP code works because it generates the right layout, I have so a problem in the final visualization of the Flash movie.

It's composed by a single list component (inst. name: theList) in a level, and the following AS code in the other:

Code: [ Select ]
var theXML:XML = new XML();
theXML.ignoreWhite = true;

theXML.onLoad = function() {
    var nodes = this.firstChild.childNodes;
    for (i=0; i<nodes.lenght; i++) {
        theList.addItem(nodes[i].firstChild.nodeValue, i);
    }
}

theXML.load("http://www.address_where_is_located_the_php_file.php");
  1. var theXML:XML = new XML();
  2. theXML.ignoreWhite = true;
  3. theXML.onLoad = function() {
  4.     var nodes = this.firstChild.childNodes;
  5.     for (i=0; i<nodes.lenght; i++) {
  6.         theList.addItem(nodes[i].firstChild.nodeValue, i);
  7.     }
  8. }
  9. theXML.load("http://www.address_where_is_located_the_php_file.php");


The list component remain unfilled with the data... what's wrong with this?
Please help me :?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 7th, 2007, 1:40 pm

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post November 8th, 2007, 1:38 pm

Code: [ Select ]
var nodes = this.firstChild.childNodes;

should be
Code: [ Select ]
var nodes = theXML.firstChild.childNodes;


In this instance I believe that the "this" refers to the callback object and not the actual xml.

Try tracing "nodes" after you create it to make sure your really getting the xml you expect.
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 42 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.