Código ActionScript :
function uploadImage(event)
{
imageFile.browse([{description: "Image Files", extension: "*.jpg;*.gif;*.png"}]);
} // End of the function
function imageDownloaded(event)
{
if (event.total == -1)
{
imagePane.contentPath = "error";
} // end if
} // End of the function
function downloadImage(file)
{
imagePane.contentPath = "http://www.midominio.pe/prueba/files" + file;
} // End of the function
System.security.allowDomain("http://www.midominio.pe/prueba");
var listener = new Object();
listener.onSelect = function (selectedFile)
{
statusArea.text = details.text = "";
statusArea.text = statusArea.text + ("Recibiendo imagen al servidor " + selectedFile.name + "\n");
selectedFile.upload("http://www.midominio.pe/prueba/upload.php");
};
listener.onOpen = function (selectedFile)
{
statusArea.text = statusArea.text + ("Subido " + selectedFile.name + "\n");
};
listener.onHTTPError = function (file, httpError)
{
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "HTTPError number: " + httpError + "\nFile: " + file.name;
};
listener.onIOError = function (file)
{
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "IOError: " + file.name;
};
listener.onSecurityError = function (file, errorString)
{
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "SecurityError: " + SecurityError + "\nFile: " + file.name;
};
listener.onComplete = function (selectedFile)
{
statusArea.text = statusArea.text + ("Subida terminada.\nNow downloading " + selectedFile.name + " to player\n");
details.text = "";
for (i in selectedFile)
{
details.text = details.text + ("<b>" + i + ":</b> " + selectedFile[i] + "\n");
} // end of for...in
downloadImage(selectedFile.name);
};
var imageFile = new flash.net.FileReference();
imageFile.addListener(listener);
uploadBtn.onPress = uploadImage;
imagePane.addEventListener("completo", imageDownloaded);
stop ();
alfa.gotoAndStop(10);
stop ();
stop ();
fscommand("fullscreen", "true");
invertido.onRelease = function ()
{
miMC.gotoAndStop(2);
};
original.onRelease = function ()
{
miMC.gotoAndStop(1);
};
