Ok, tienes que enviar una variable a PHP, la parte de Flash sería
Código ActionScript :
submit.addEventListener("mouseDown", sendData)
function sendData(evt:Event){
var myData:URLRequest = new URLRequest("save.php")
myData.method = URLRequestMethod.POST
var variables:URLVariables = new URLVariables()
variables.encontrado = true;
myData.data = variables
var loader:URLLoader = new URLLoader()
loader.dataFormat = URLLoaderDataFormat.VARIABLES
loader.addEventListener(Event.COMPLETE, dataOnLoad)
loader.load(myData)
}
Ahí lo enviaste, el PHP recibe $_POST['encontrado'] y lo escribe.
El punto es que antes de hacer esto, tienes que cargarlo y ver si ya no es true (en ese caso el boton anterior no tiene que aparecer) Sería algo así
Código ActionScript :
//Create the URLLOader instance
var myLoader:URLLoader = new URLLoader()
//the data will come as URL-encoded variables
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES
//Load using an URLRequest, even beeing local
myLoader.load(new URLRequest("archivo.txt"))
//onLoad handler listener
myLoader.addEventListener(Event.COMPLETE, onDataLoad)
//Error handling
myLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError)
myLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError)
//Could be an error or just a message
myLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus)
//add a listener for the complete event
function onDataLoad(evt:Event){
if(evt.target.data.encontrado == "true") trace("ya fue encontrado")
else trace("No fue encontrado")
}
//error callbacks
function onIOError(evt:IOErrorEvent){
trace("IOError: "+evt.text)
}
function onHTTPStatus(evt:HTTPStatusEvent){
trace("HTTPStatus: "+evt.status)
}
function onSecurityError(evt:SecurityErrorEvent){
trace("SecurityError: "+evt.text)
}
Todo el control de errores es optativo, lo importante es que chequees si ya lo tienes a true. Lo carga como String, no como booleano, por eso etoy haciendo el if contra "true", es decir entre comillas
Jorge