pass value to the webserver

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

Post 3+ Months Ago

Hi

In my actionscript code I am opeining an image in the webpage and when the user clicks it gets the coordinates of the point. How can I send this value to the webserver.

Thanks
  • 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

im not really sure of what you need but lets try this , u can use POST or GET to send values to webservers , you will need a server side script for that (php) .


try this :
Code: [ Select ]
image.onRelease = function() {
        getURL("http://www.xyz.com/script.php?coordinates=" + Variable);
}
  1. image.onRelease = function() {
  2.         getURL("http://www.xyz.com/script.php?coordinates=" + Variable);
  3. }


&

you can also use loadvars , load or sendAndLoad read more about it @
http://www.adobe.com/support/flash/acti ... ry427.html

http://www.adobe.com/support/flash/acti ... ry435.html
  • krismeister
  • Graduate
  • Graduate
  • krismeister
  • Posts: 202

Post 3+ Months Ago

Code: [ Select ]
this.submit_btn.onRelease = function() {
    var emailResponse:LoadVars = new LoadVars();

    var email:LoadVars = new LoadVars();
    email.emailFrom = emailFrom_txt.text;
    email.emailTo = emailTo_txt.text;
    email.emailSubject = emailSubject_txt.text;
    email.emailBody = emailBody_txt.text;
    email.sendAndLoad("http://www.yoursite.com/email.cfm", emailResponse,
"POST");
    emailResponse.onLoad = function() {
        debug_txt.text = this.result;
    };
};
  1. this.submit_btn.onRelease = function() {
  2.     var emailResponse:LoadVars = new LoadVars();
  3.     var email:LoadVars = new LoadVars();
  4.     email.emailFrom = emailFrom_txt.text;
  5.     email.emailTo = emailTo_txt.text;
  6.     email.emailSubject = emailSubject_txt.text;
  7.     email.emailBody = emailBody_txt.text;
  8.     email.sendAndLoad("http://www.yoursite.com/email.cfm", emailResponse,
  9. "POST");
  10.     emailResponse.onLoad = function() {
  11.         debug_txt.text = this.result;
  12.     };
  13. };



There is also these sweet libraries if you're interested something better:
http://amfphp.sourceforge.net/
http://swxformat.org/

They really help because you can pass whole objects from flash to PHP and back cutting out alot of code you usually write to set it up.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 11 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
 
cron
 

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