Solved

sendAndLoad -> php not executed

Posted on 2003-10-29
7
1,013 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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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 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…
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.

772 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