Loading movie

  • makhan
  • Novice
  • Novice
  • makhan
  • Posts: 31

Post 3+ Months Ago

I have this code that sends the mouse x and y values to php. I want to open a new movie after it sends its parameters to php which displays like please waite or processing. And than I want to open up a new swf file as I get the output back from the php.
Can some please help me with the code here
Code: [ Select ]

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");



}
 
  1. var linePoints:Array = new Array();
  2. createEmptyMovieClip("Line", _root.getNextHighestDepth());
  3. Line.duplicateMovieClip("Image", Line.getDepth() - 1);
  4. Image.loadMovie("newimage.jpg");
  5. Line.lineStyle(1,0x000000,100);
  6. function recordPoint() {
  7.     //this records the current mouse position in the linePoints array 
  8.     // and returns a single element which is an array of the two coordinates
  9.     //for the drawing command
  10.     return(linePoints[linePoints.push([_xmouse,_ymouse])-1])
  11.     
  12. }
  13. //I have avoided double checks of the _xmouse and _ymouse
  14.     //properties between the recording and the drawing commands
  15.     //to avoid a potential difference between them if the mouse
  16.     //is moving quickly 
  17.     //that's why I used moveTo.apply etc below.
  18.     //may not be important
  19. onMouseDown = function ()
  20. {
  21. Line.moveTo.apply(Line,recordPoint());
  22. onMouseMove = function ()
  23. { Line.lineTo.apply(Line,recordPoint());}
  24. }
  25. var myLV:LoadVars = new LoadVars();
  26. var myReplyLV:LoadVars = new LoadVars();
  27. myReplyLV.onLoad = function(success) {
  28.     trace('reply received')
  29.     for (var serverReply in this) {
  30.         trace("")
  31.         trace(serverReply+"="+this[serverReply])
  32.     }
  33.     
  34. };
  35. onMouseUp=function()
  36. {
  37. onMouseMove=null;
  38. trace("linepoints array:"+linePoints.join("|"));
  39. //you will see the above trace output provides coordinates as csv pairs and each
  40. //coordinate pair separated by a pipe ('|') character - you can change this
  41. //this may not the best place to do this, but is an example
  42.                                              
  43. myLV.linePoints=linePoints.join("|");
  44. //send only:
  45. //myLV.send("http://localhost/test/linepoints.php","_blank","POST"); //could be GET perhaps
  46. //I thought POST didn't work from the flash ide...only from a browser
  47. //but this seems to work regardless:
  48. myLV.send("http://localhost:8080/linepoints.php","_blank","POST");
  49. }
  50.  
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

sendAndLoad rather than just send

http://www.adobe.com/support/flash/acti ... ry435.html
http://livedocs.adobe.com/flash/mx2004/ ... 01419.html
http://www.ozzu.com/flash-forum/sendandload-don-work-t25671.html

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 16 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.