PDA

View Full Version : Loading external swf into main swf (PHP scripting)



dirtbikephil
May 12th, 2003, 06:25 PM
Alright, I'm going to try to explain this the best I can.

First off, here are the files I'm dealing with:
1. guestbook.php
2. guestbook.txt
3. guestbook.swf
4. main.swf

I have a form on guestbook.swf that sends the data to guestbook.php which then reads and writes to guestbook.txt. Guestbook.swf works fine as a standalone movie - it'll read the text file and then display the data in the dynamic text box named 'guestbook'.

However, when I try to load guestbook.swf into a movie clip named 'content' from main.swf the data is not being shown in my dynamic text box ('guestbook'). I'm pretting sure it has something to due with a targeting issue, but I'm not sure how to do this.

Here is the code that I think is causing the problem (action for submit form in guestbook.swf):

on(release){
if(name eq ""){
warning = "You forgot your name!";
}else if(message eq ""){
warning = "Don't forget to leave a message.";
}else{
submit = "yes"
numHigh = 5;
numLow = 0;
_root.content.guestbook = "Loading new data...";
loadVariablesNum("guestbook.php", 0, "Post");
}
}

I've tried changing '0' to "_root.content.guestbook" in loadVariablesNum but when I tested it out, as soon as I click on submit it opens up another window with the address guestbook.php. I want the data to load in text box 'guestbook' not in another window.

I hope that all makes sense. Please help, I'd really appreciate it. I'm new to Flash.

Thanks.

mjULTRA
June 2nd, 2003, 12:50 PM
just a guess, but wouldn't you change 'guestbook.php' to 'guestbook.txt', and then make sure that it was targeting your text box?