# Multiple .swf + php + variables

**URL:** https://forum.kirupa.com/t/multiple-swf-php-variables/121240
**Category:** Uncategorized
**Created:** [September 1, 2004, 8:10am UTC](https://forum.kirupa.com/t/multiple-swf-php-variables/121240 "2004-09-01T08:10:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Urme](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Urme](https://forum.kirupa.com/u/Urme)
#### Post date: [September 1, 2004, 8:10am UTC](https://forum.kirupa.com/t/multiple-swf-php-variables/121240/1 "2004-09-01T08:10:01Z")

</div>

I’m using Flash MX 2004.

```
I will explain how my .swf files etc works first.

I have 3 .swf files.
index.swf
page1.swf
page2.swf

```

Index.swf is the “top” flash file… and includes page1 and page2. First thing that happens is that index.swf got a small intro and on frame 100 (label: page1) I’m loading page1.swf with the following script:

```php

    stop();
    undersidor_movie.unloadMovie();
    undersidor_movie.loadMovie("page1.swf");
    

```

```
On frame 1 in page1.swf I'm calling a php-script that will load text and images. Like this:

```

```php

    page1Data = new LoadVars() 
    page1Data.ref = this 
    page1Data.load("page1.php") 
    page1Data.onLoad = function(success){ 
    	if(success){  
    			text1 = this["text1"];
    			text2 = this["text2"];
    			text3 = this["text3"];
    	} else trace("Error loading data") 
    }
    

```

I have a menu in index.swf and if you click on “Page 2” in that menu index.swf will load page2 on frame 101(label:page2) in index.swf.  
And it uses the same procedure as page1… you unload the movie, load page2.swf. Then calling a php script (page2.php) that will include the text etc for page2.swf.

```
I actually have 5 pages that works like this.

Ok my problem is this:

In page1.swf I have a text1 variable as you can see that variable is a "internal" link like this:

```

```php

    <a href=\"asfunction:rootlink,page2|6\">Link 1</a>
    

```

```
The function rootlink looks like this. (It is in page1.swf)

```

```php

    function rootlink(arg){
    	var argArray = arg.split("|");
    	_root.gotoAndPlay(argArray[0]);
    	caseid = argArray[1];
    }
    

```

```
As you can see this link will play Label: page2 in index.swf and jump to page2.swf.

**My question is, how can I get the variable "caseid" to follow to page2.swf? I need that variable in page2.swf so I can load the correct data from the .php file. Like this:**

```

```php

    page2Data = new LoadVars() 
    page2Data.ref = this 
    page2Data.load("page2.php?Id="+caseid)
    page2Data.onLoad = function(success){ 
    	if(success){  
    			text1 = this["text1"];
    			text2 = this["text2"];
    			text3 = this["text3"];
    	} else trace("Error loading data") 
    }
    

```

```
I'm very new to Actionscripts and not sure if this is the best way to code it.. need serious help :(

```

P.S don’t complain about my english grammar please 🙂
