# Loading external swf into movieclip

**URL:** <https://forum.kirupa.com/t/loading-external-swf-into-movieclip/20738>\
**Category:** programming\
**Created:** [May 12, 2003, 10:24pm UTC](https://forum.kirupa.com/t/loading-external-swf-into-movieclip/20738 "2003-05-12T22:24:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirtbikephil](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@dirtbikephil](https://forum.kirupa.com/u/dirtbikephil)\
**Post date:** [May 12, 2003, 10:24pm UTC](https://forum.kirupa.com/t/loading-external-swf-into-movieclip/20738/1 "2003-05-12T22:24:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 16, 2003, 9:51pm UTC](https://forum.kirupa.com/t/loading-external-swf-into-movieclip/20738/2 "2003-05-16T21:51:01Z")

</div>

flash-db guestbook? 😉  
you can’t use a target witl loadMovieNum, gotta use loadMovie!  
try \_root.content.loadVariables(“guestbook.php”)  
(maybe add in the POST again if it doesn’t work…)
