Thanks man, I have this code. Can you please point me where should I modify so that a swf file with the "processing " message starts as soon as I send the values to the php file and when its done I load another image into my movie
var linePoints:Array = new Array();
createEmptyMovieClip("Line", _root.getNextHighestDepth());
Line.duplicateMovieClip("Image", Line.getDepth() - 1);
Image.loadMovie("newimage.jpg");
Line.lineStyle(1,0x000000,100);
function recordPoint() {
//this records the current mouse position in the linePoints array
// and returns a single element which is an array of the two coordinates
//for the drawing command
return(linePoints[linePoints.push([_xmouse,_ymouse])-1])
}
//I have avoided double checks of the _xmouse and _ymouse
//properties between the recording and the drawing commands
//to avoid a potential difference between them if the mouse
//is moving quickly
//that's why I used moveTo.apply etc below.
//may not be important
onMouseDown = function ()
{
Line.moveTo.apply(Line,recordPoint());
onMouseMove = function ()
{ Line.lineTo.apply(Line,recordPoint());}
}
var myLV:LoadVars = new LoadVars();
var myReplyLV:LoadVars = new LoadVars();
myReplyLV.onLoad = function(success) {
trace('reply received')
for (var serverReply in this) {
trace("")
trace(serverReply+"="+this[serverReply])
}
};
onMouseUp=function()
{
onMouseMove=null;
trace("linepoints array:"+linePoints.join("|"));
//you will see the above trace output provides coordinates as csv pairs and each
//coordinate pair separated by a pipe ('|') character - you can change this
//this may not the best place to do this, but is an example
myLV.linePoints=linePoints.join("|");
//send only:
//myLV.send("http://localhost/test/linepoints.php","_blank","POST"); //could be GET perhaps
//I thought POST didn't work from the flash ide...only from a browser
//but this seems to work regardless:
myLV.send("http://localhost:8080/linepoints.php","_blank","POST");
}