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
Solved

sendAndLoad -> php not executed

Posted on 2003-10-29
7
1,016 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
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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

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

Suggested Solutions

Title # Comments Views Activity
Youtube video error 30 810
Im getting a black border top and bottom of any you tube videoes I look at. 3 64
Adobe flash player memory exhaustion 6 96
Adobe Products Forum? 3 158
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
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.

828 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