# Complex problem: loading external text in a re-used SWF

**URL:** <https://forum.kirupa.com/t/complex-problem-loading-external-text-in-a-re-used-swf/136202>\
**Category:** Uncategorized\
**Created:** [February 3, 2005, 12:37am UTC](https://forum.kirupa.com/t/complex-problem-loading-external-text-in-a-re-used-swf/136202 "2005-02-03T00:37:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IMJ](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@IMJ](https://forum.kirupa.com/u/IMJ)\
**Post date:** [February 3, 2005, 12:37am UTC](https://forum.kirupa.com/t/complex-problem-loading-external-text-in-a-re-used-swf/136202/1 "2005-02-03T00:37:11Z")

</div>

Hey guys,

I’ve got a rather complex problem here. It’s a rather long story, but i’ll try to explain it as short and as clear as possible.

I’m working on a site for a client. On each page there’s a Flash header, in which it loads a JPG and a TXT externally. It all works fine and all, but I want to re-use the exported SWF for each page, without changing the location of the JPG and TXT.

I managed to get it working for the JPG by changing my code from

```auto

container.loadMovie()

```

to

```auto

container.loadMovie(img)

```

in the FLA and changing the code in the PHP which holds the SWF from

```auto

<embed src="flash/header.swf">
<param name="movie" value="header.swf">

```

to

```auto

<embed src="flash/header.swf?img=home/header.jpg">
<param name="movie" value="header.swf?img=home/header.jpg">

```

Basically, all i need to do is open the same SWF in each PHP, but by adding some coding to specify the content of the Flash header.

My problem arises when i want to do the same for the externally loaded TXT. The coding is based on the tutorial on Kirupa and looks like the following:

```auto

onClipEvent(load) {
	loadText = new LoadVars();
	loadText.load(txtFile);
	loadText.onLoad = function(success) {
		if(success) {
			headerText.html = true;
			headerText.htmlText = this.Content;
		}
	}
}

```

This code is applied a movieclip “containerText” which is in another movieclip “info\_mc”. My original plan was to change my code in PHP to:

```auto

<embed src="flash/header.swf?img=home/header.jpg&txtFile=home/content.txt">
<param name="movie" value="header.swf?img=home/header.jpg&txtFile=home/content.txt">

```

But unfortunately, it didnt work. Since the code is not applied in to a movieclip in the root, i thought maybe i should get the path right and change it to:

```auto

<embed src="flash/header.swf?img=home/header.jpg&info_mc.containerText.txtFile=home/content.txt">
<param name="movie" value="header.swf?img=home/header.jpg&info_mc.containerText.txtFile=home/content.txt">

```

I’m afraid that was just naive thinking, cos that didnt work for me either. Does anyone has an idea how I could get this working? It would be very appreciated!

Thanks for anyone for reading this long post and paying attention to it.
