Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / August 2007



Tip: Looking for answers? Try searching our database.

Flash & PHP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
all_begin - 10 Aug 2007 17:27 GMT
I have made a simple form with Flash 8, and on the first frame on the main
timeline, i have addes he following AC code:

fieldsFilled = new Object();
fieldsFilled.onKeyUp = function() {
if(destMail_txt.text != ' ' && senderName_txt.text != ' ' && senderBody != ' '
) {
send_btn.enabled = true;
}
else {
send_btn.enabled = false;
}
}
Key.addListener(fieldsFilled);
send_btn.enabled = false;
var sendMail_lv:LoadVars = new LoadVars();
send_btn.onRelease = function() {
sendMail_lv.destMail = destMail_txt.text;
sendMail_lv.senderName = senderName_txt.text;
sendMail_lv.senderBody = senderBody_txt.text;
sendMAil_lv.sendAndLoad(http://PATHtoMYserver/sendMail.php", sendMail_lv,
"POST");
}

Then i have a PHP file on my server that i tested and works perfectly. The
problem is thta Flash doesn't want to communicate with PHP: what can i do? Is
there a problem in the script? I've tried several times during the last two
days, but not success.

Thanks,
Vinnie
Krishana_79 - 21 Aug 2007 12:04 GMT
Hi all_begin,

here you have to create an another loadvar (which will be the return the data
in order to you request ) object like to have made "var sendMail_lv:LoadVars =
new LoadVars();". The newer may be "var resultMail_lv:LoadVars = new
LoadVars();" and then you have to put this "resultMail_lv" in "sendAndLoad"
method of flash like :
sendMAil_lv.sendAndLoad(http://PATHtoMYserver/sendMail.php", resultMail_lv
"POST");.

Now, you have to write bit of code in your send_btn.onRelease  function to
load data that you want to get from your php file.
//----------------
   resultMail_lv.onLoad = function(success:Boolean) {
      if (success) {
         result_ta.text = resultMail_lv.welcomeMessage;
      } else {
        result_ta.text = "Error connecting to server.";
     }
    };
//------------------

here " result_ta " will be the text area in which you can show the data which
is cominig from your php side.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.