Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

sendAndLoad -> php not executed

Posted on 2003-10-29
7
Medium Priority
?
1,032 Views
Last Modified: 2012-06-21
sendAndLoad - php not executed
on (release) {
mijnvar = new loadVars();
mijnvar.naam = _root.naam;
mijnvar.contact = _root.persoon;
mijnvar.adres = _root.adres;
mijnvar.from = _root.MailFrom;
mijnvar.tel = _root.telefoon;
mijnvar.bericht = _root.feedback;
if (mijnvar.sendAndLoad("http://URL/verzendflash.php",0,"POST")) {
gotoAndPlay(3);
}
}

I do not find the "verzendflash.php"-file in the acces-log of my site, so I think the sendAndLoad does not work/does not get executed => I do not jump to the third frame.

Thanks for your answer,

Mariëlle

0
Comment
Question by:Fivez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 5

Expert Comment

by:Calron
ID: 9640301
Hello Fivez (next time don't accept the answer if you haven't gotten it to work yet .... I would have continued helping you ... :)  )

As to your current question, make sure that the url you point the send and load to is correct: http://URL/verzendflash.php  has to be accessible by browser as well.
Then are you testing this locally or on a server, because depending on that you will have to change the url.
0
 

Author Comment

by:Fivez
ID: 9640490
I would not have accepted the answer if it did not work fine for at least three times.
The thing is: it worked fine untill I decided to compress the file while publishing to Flash Player 5. After the compression/conversion the sendAndLoad no longer worked.
It sounds strange: I know, but even returning to a copy before the compressing and returning to Flash player 6 did not help.

So now I've returned to the loadVariablesNum(...) and everything works fine again ! (If you remember loadVariablesNum(...) did not work before ... !)

If you can explain me how come, fine. But sendAndLoad is no longer in use.

0
 
LVL 5

Accepted Solution

by:
Calron earned 2000 total points
ID: 9640523
Well, the LoadVars object is only available starting Flash 6 (or MX). So saving it as Flash 5 will either remove it from the code, or just render it useless. And if you have not LoadVars, then there is no sendAndLoad ..... :(

I am not sure what flash does when you set it to a lower version and then return to a higher version. But in Flash 6 the LoadVars is available and should work, so I would check the settings in the file and check the code.
Also try save as and make sure that you have flash MX selected ot later.
The last resort would be to create a new flash file in version 6 and then copy everything over from your current file.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Fivez
ID: 9640565
It works now: I am not changing a bit. Next time I create a form I will try the sendAndLoad again, but for now I am overjoyed it works !
0
 
LVL 5

Expert Comment

by:Calron
ID: 9640593
Well, I'm glad it worked out.

I know it takes a bit of fiddling, I have done that quite a few times as well and tried out different things along the way. :)
0
 

Expert Comment

by:jvanv8
ID: 10018568
Even if you WERE exporting for Flash 6+ the code wouldn't work.
You have:
if (mijnvar.sendAndLoad("http://URL/verzendflash.php",0,"POST")) {
gotoAndPlay(3);
}

The second parameter which you stated as 0 MUST be an object otherwise the sendAndLoad function returns false.  Therefore, it probably never calls the php file.  Do this instead:

receiver_lv = new LoadVars();
receiver_lv.onLoad = function (){
     trace(receiver_lv.somePHPVariable);
     gotoAndPlay(3);
}
mijnvar.sendAndLoad("http://URL/verzendflash.php", receiver_lv, "POST");


that should work.
- John
0
 

Expert Comment

by:gieson
ID: 10418137
To clarify:

To use sendAndLoad you need to establish two LoadVars. Otherwise sendAndLoad does not work as you would expect.

// actionscript :
receiver_lv = new LoadVars();
sender_lv = new LoadVars();

receiver_lv.onLoad = function (){
     trace(receiver_lv.somePHPVariable);
     gotoAndPlay(3);
}

sender_lv.somevarA = "something";
sender_lv.someOtherVar = "anotherthing";
sender_lv.sendAndLoad("http://URL/verzendflash.php", receiver_lv, "POST");

//

The old loadVars("url", receive_MC, "POST") routine is a real pain in the butt... however the send and load is much more elegant.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question