raxper como estas, bueno aca pongo un ejemplo de como leer desde flash el php
pero si queres que lea el php lea mysql ya es otra historia
crea un texto dinamico y ponele de nombre de instancia texto_txt
y en el primer fotograma pone este codigo
Código:
lecutura = new LoadVars();
lecutura.load("ejemplo_lectura.php",lecutura);
lecutura.onLoad = function() {
texto_txt.text = this.variable_texto;
};
luego anda al blog de notas y
guarda el archivo con el nombre ejemplo_lectura.php
Código:
<?
print "&variable_texto=hola envio texto a flash";
?>
este otro ejemplo de enviar datos de un formulario y recibir "texto como respuesta si todo ha salido "ok"
en php:
Cita: <?
// Part One - Initiate a mySQL Database Connection
// Database Connectivity Variables and other Variables
$DBhost = "localhost"; // Database Server
$DBuser = "root"; // Database User
$DBpass = ""; // Database Pass
$DBName = "turorials"; // Database Name
$table = "guestbook"; // Database Table
$numComments = 10; // Number of Comments per page
// Connect to mySQL Server
$DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Error in GuestBook Application: " . mysql_error());
// Select mySQL Database
mysql_select_db($DBName, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
// Part Two - Choose what action to perform
$action = $_GET['action'];
switch($action) {
case 'write' :
// Recieve Variables From Flash
$name = ereg_replace("&", "%26", $_POST['yourname']);
$email = ereg_replace("&", "%26", $_POST['youremail']);
$comments = ereg_replace("&", "%26", $_POST['yourcomments']);
$submit = $_POST['submit'];
// Current system date in yyyy-mm-dd format
$submitted_on = date ("Y-m-d H:i:s",time());
// Check if its submitted from Flash
if($submit == 'Yes'){
// Insert the data into the mysql table
$sql = 'INSERT INTO ' . $table .
' (`ID`,
`name`,
`email`,
`comments`,
`time`
)
VALUES
(\'\','
. '\'' . $name . '\','
. '\'' . $email . '\','
. '\'' . $comments . '\','
. '\'' . $submitted_on . '\'
)';
$insert = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
//aca enviamos a flash texto
print "&gb_status=este es el texto que voy a recibir en flash.&done=yes&";
return;
}
print "&_root.write.gb_status=Error!&";
break;
}
?>
en flash
Cita: on(click){
/*
Modify these reference paths to yours if you
have changed them. Also modify gb_status
reference path if required
*/
yourname = _parent._parent.write.yourname.text;
youremail = _parent._parent.write.youremail.text;
yourcomments = _parent._parent.write.yourcomments.text;
// Check variable data
if (yourname eq "") {
_parent._parent.write.gb_status.text = "Required: Name";
} else if (youremail eq "") {
_parent._parent.write.gb_status.text = "Required: Email Address";
} else if (!youremail.length || youremail.indexOf("@") == -1 || youremail.indexOf(".") == -1) {
_parent._parent.write.gb_status.text = "Required: Valid Email Address";
} else if (yourcomments eq "") {
_parent._parent.write.gb_status.text = "Required: Comments";
} else {
_parent._parent.write.gb_status.text = "Please wait...";
newEntry = new LoadVars()
newEntry.ref = this
newEntry.submit = "Yes"
newEntry.yourname = yourname
newEntry.youremail = youremail
newEntry.yourcomments = yourcomments
newEntry.sendAndLoad("GuestBook.php?action=write&r ="+random(999), newEntry, "POST")
newEntry.onLoad = function(success){
if(success){
_parent._parent.write.gb_status.text = this.gb_status;
_parent._parent.read.loadEntries("Default", 10);
// Clear fields
_parent._parent.write.yourname.text = "";
_parent._parent.write.youremail.text = "";
_parent._parent.write.yourcomments.text = "";
}
}
}
}
el link de descarga
http://www.flash-db.com/Tutorials/download.php?id=159
Vale aclarar que para que podamos leer o escribir php debe estar alojado en un servidor; espero que te haya podido ayudar saludos!