ok, gracias; mira encontré éste enlace pero creo que le falta algo...
http://www.flash-remoting.com/examples/fr2004pt1/ Bueno , mis inicios en OOP, y mis conocimeintos en AS son aún muy escasos de lógica, he intentado lo sgte(según el artículo del enlace):
en AS:
Código :
import mx.remoting.NetServices;
// Connect to the gateway and create a service object
if (connected == null) {
connected = true;
NetServices.setDefaultGatewayUrl("http://localhost/remoting/gateway.php");
var my_conn = NetServices.createGatewayConnection();
var myService = my_conn.getService("BuscarProductos", this);
}
var simpleListener = new Object();
submit_pb.addEventListener("click", onSubmit);
// Event handler for button
function onSubmit () {
myService.BuscarProductos({search:search_txt.text});
}
// Responder function for result
function BuscarProductos_Result (result_rs) {
var temp = "";
temp += "There were " + result_rs.getLength();
temp += " records returned.";
results_txt.text = temp;
// The following line binds the recordset to the grid
gr.dataProvider = result_rs;
}
// Responder function for status
function BuscarProductos_Status (error) {
results_txt.text = "There was an error: " + error.description;
}
y en el php de servicio:
Código :
<?php
class BuscarProductos {
function BuscarProductos() { /* constructor */
$this->methodTable = array(
'getSearchResult' => array(
'description' => 'Searches the database and returns a result.',
'access' => 'remote',
'arguments' => array('search')
)
);
}
function BuscarProductos($search) {
if (!$link = mysql_pconnect('localhost', 'user', 'pass'))
return mysql_error();
if (!mysql_select_db('Stock', $link)) return mysql_error();
$query = 'SELECT idnum,idorden,nm,material,comp,fcrea,estado ';
$query .= (!empty($search)) ? " WHERE idorden LIKE '%$search%'" : '';
if (!($result = mysql_query($query, $link))) return mysql_error();
return $result;
}
}
?>
Bueno sin ningún resultado.
Por lo pronto voy a probar lo anterior..