# Passing (URL) variables between two swf (html) files

**URL:** <https://forum.kirupa.com/t/passing-url-variables-between-two-swf-html-files/284690>\
**Category:** flash\
**Created:** [March 22, 2009, 1:04pm UTC](https://forum.kirupa.com/t/passing-url-variables-between-two-swf-html-files/284690 "2009-03-22T13:04:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkamp](https://avatars.discourse-cdn.com/v4/letter/n/cc9497/32.png) [@nkamp](https://forum.kirupa.com/u/nkamp)\
**Post date:** [March 22, 2009, 1:04pm UTC](https://forum.kirupa.com/t/passing-url-variables-between-two-swf-html-files/284690/1 "2009-03-22T13:04:26Z")

</div>

Hello,  
I’m asking myself how do I passing variables between two swf (html) files For instance how can I request the variable “var\_1” in the file blikvanger.swf (or blikvanger.html).

Here is my code of one as file (contact.as):

```auto

...
homelink.addEventListener(TextEvent.LINK, linkHandler);  			
homelink.htmlText = "<a href=\"event:../blikvanger.html\">THUIS</a><br>";
homelink.styleSheet = myCSS;  			  			
//function linkHome(event:MouseEvent):void {  			
function linkHandler(linkEvent:TextEvent):void {  				
  var url:String = "../blikvanger.html";  				
  var variables:URLVariables = new URLVariables();  				
  variables.exampleSessionId = new Date().getTime();  				 
  variables.exampleUserLabel = "Home page Yke Ruesink";  				    
  variables.var_1	= 'THUIS';				
  var request:URLRequest = new URLRequest(url);  				
  request.data = variables;  				  				

  try {              					
    navigateToURL(request, "_self");  				
  }  				
  catch (e:Error) {  					
    // handle error here  				
    }  			
} //End private function URLContact

```

From the code above, I’m calling the second file (blikvanger.html). In this file is the swf blikvanger.swf embedded.

```auto

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="blikvanger" align="top">  	
  <param name="allowScriptAccess" value="sameDomain" />  	
  <param name="allowFullScreen" value="false" />  	
  <param name="movie" value="blikvanger.swf" />  	
  <param name="quality" value="high" />  
  <param name="scale" value="noscale" />  	
  <param name="bgcolor" value="#333333" />	  	
  <embed src="blikvanger.swf" quality="high" scale="noscale" bgcolor="#333333" width="100%" height="100%" name="blikvanger" align="top" allowScriptAccess="sameDomain" allowFullScreen="false"   							
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />  	
</object>

```

I know alternativ from asp/php:

```auto

<a href=\"event:../blikvanger.html?var_1="true"&var_2="etc"\">THUIS</a>

```

**BUT HOW DO YOU EXCHANGE VARIABLES BETWEEN TWO SWF (SWF -\> HTML) FILES?**

Nico
