Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

targeting a movie on layer 1 from a php file

Status
Not open for further replies.

raznov

Programmer
Apr 8, 2002
110
US
I have a flash movie that has a form, when the user hits the send button, certain information is passed to a php file. The problem occurs when the last bit of information is needed to be passed back to the flash movie, it will not go.

I discovered through debugging that the reason this is occuring is that the php file cannot find the flash movie since it is on layer 1 loaded into the main movie.

My question is how do I target the php file to send the required info back to the flash movie on layer 1.

the php bit reads like this.. it is fairly simple and adapted from a widely available tutorial...the php file and both flash movies all live in the same directory on the server.


//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Done!";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
 
You can't send the variable directly to a movie - it has to be requested through loadVariables(). You can either add an action to the movie on _level1 to pick up the PHP output or use the movie on _level0 to relay it. Slainte

 
Sorry, maybe I was too vague... you see I know the entire form works because I tested it as a single movie not loaded into the main movie.

There is a text field in the form called "answer", and on the frame that it appears.. there is action script that called the variable, mailform which is the name of the php file. mailform.php.

loadVariablesNum (mailform, 0);
answer = "please wait for confirmation ...";
stop ();


again... all of this works fine when tested as a single .swf on level 0, but when loaded into the main movie which is level 0 and the contactus movie is level 1, the last bit of info is never recieved.

if you want, i can upload the movies somewhere and you can look at the .fla.

i of course can simple change the funcitioning of the movie so that it is not loading into the main movie, but for future reference, I would like to know how to solve the problem

k

 
You're loading the variables on to level0 which is why they're not showing up on level1 try this:

loadVariablesNum ("mailform.php", 1);
Slainte

 
Hi, thanks for the suggestion. I actually solved the problem by putting it in a movie clip in the main movie and using dot syntax to target it. I guess the same will work for having it targeted on level1. I will try it.

thanks again... im so happy that i finally solved this problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top