Solved

sendAndLoad -> php not executed

Posted on 2003-10-29
7
1,018 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 500 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

696 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