Scusa se sono paloso...
Ho un altro problema
1.Ho il database.
Carico dal database i dati tramite un file php in XML poi in un testo dinamico in flash..
Sicome sul databse ci sono piu dati, su file XML mi apare tutti i campi...
Ma in flash solo la prima riga...
Non so se mi spiego, non sono italiano...
Ti faccio un esempio...
Quote:
|
// dati per la connessione al database
$db_host = "192.168.xxx.xxx";
$db_user = "xxxxxxx";
$db_password = "xxxxxxxxx";
$db_name = "xxxxxxxx";
// connessione al database
$db = mysql_connect ($db_host, $db_user, $db_password);
$db_forum = mysql_select_db ($db_name, $db);
$query = "SELECT nome, cognome, indirizzo from characters WHERE online=1 order by 'nome'";
$query_results = mysql_query($query);
echo "\n";
echo "\n";
while($line = mysql_fetch_assoc($results)) {
echo "" . $line["nome"] . "\n";
echo "" . $line["cognome"] . "\n";
echo "" . $line["indirizzo"] . "\n";
echo "\n";
}
?>
|
Poi in XML m apare cosi:
[quote]
<dati>
>Romina
>Rossi
>Mateotti
>Romeo
>Verdi
>Terassa>
dati>
[quote]
Ma nel testo dinamico mi apare solo la prima riga, cioè:
Romina Rossi Mateotti
Ecco qui lo script flash:
Quote:
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("http://192.168.1.20/dati.php");
function loadXML(loaded)
{
var _loc1 = _root;
if (loaded)
{
_loc1.nomi = this.firstChild.childNodes[1].firstChild.nodeValue;
_loc1.cognomi = this.firstChild.childNodes[2].firstChild.nodeValue;
_loc1.indirizzo = this.firstChild.childNodes[3].firstChild.nodeValue;
nome_txt.text = _loc1.server;
cognome.text = _loc1.games;
indirizzo.text = _loc1.games;
return;
} // end if
trace ("file not loaded!");
} // End of the function
|