Solved

sendAndLoad -> php not executed

Posted on 2003-10-29
7
1,007 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
7 Comments
 
LVL 5

Expert Comment

by:Calron
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Fivez
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now