grazie per la risposta, pero' vedo che non cambia niente, ho messo il codice che mi hai dato tu
sul primo fotogramma chiave ho messo:
codice:
btn.onRelease=function(){
read_external()
}
function read_external(){
loader = new LoadVars();
loader.onLoad = function(success) {
if(success){
if(this.ok){
reset_fields()
j=1
while(this["username"+j] != undefined){
_root.username.htmlText += this["username" + j];
_root.password.htmlText += this["password" + j];
_root.email.htmlText += this["email" + j];
_root.name.htmlText += this["name" + j];
_root.surname.htmlText += this["surname" + j];
_root.address.htmlText += this["address" + j];
_root.sesso.htmlText += this["sesso" + j];
_root.capelli.htmlText += this["capelli" + j];
_root.occhi.htmlText += this["occhi" + j];
j++
}
_root.output.text = "ok";
}else{
reset_fileds()
}
}else{
trace("errore caricamento dati esterni: file flash-estrarre.php")
}
}
loader.load("flash-estrarre.php");
}
function reset_fields(){
_root.username.htmlText = "";
_root.password.htmlText = "";
_root.email.htmlText = "";
_root.name.htmlText = "";
_root.surname.htmlText = "";
_root.address.htmlText = "";
_root.sesso.htmlText = "";
_root.capelli.htmlText = "";
_root.occhi.htmlText = "";
}
sul pulsante con istanza btn, ho messo questo:
codice:
on(release){ read_external() }
nel file php flash-estrarre.php questo:
codice:
<?php
// dati per la connessione al database
$db_host = "localhost";
$db_user = "root";
$db_password = "";
$db_name = "login";
// connessione al database
$db = mysql_connect ($db_host, $db_user, $db_password);
$db_forum = mysql_select_db ($db_name, $db);
$query = "SELECT `username`, `password`, `email`, `name`, `surname`, `address`, `sesso`, `capelli`, `occhi` FROM `user` ORDER BY `name`";
$query_results = mysql_query($query);
$i = 0;
while($fetch = mysql_fetch_array($query_results))
{
$i++;
echo "&username".$i."=".$fetch['username']."
";
echo "&password".$i."=".$fetch['password']."
";
echo "&email".$i."=".$fetch['email']."
";
echo "&name".$i."=".$fetch['name']."
";
echo "&surname".$i."=".$fetch['surname']."
";
echo "&address".$i."=".$fetch['address']."
";
echo "&sesso".$i."=".$fetch['sesso']."
";
echo "&capelli".$i."=".$fetch['capelli']."
";
echo "&occhi".$i."=".$fetch['occhi']."
";
}
if($i)
{
echo "&i=".$i;
echo "&ok=1";
echo "&stop=1";
}
else
{
echo "&ok=0";
echo "&stop=1";
}
?>