# Run different functions depending on domain

**URL:** https://forum.kirupa.com/t/run-different-functions-depending-on-domain/277301
**Category:** flash
**Created:** [December 10, 2008, 2:07pm UTC](https://forum.kirupa.com/t/run-different-functions-depending-on-domain/277301 "2008-12-10T14:07:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![danoprey](https://avatars.discourse-cdn.com/v4/letter/d/8dc957/32.png) [@danoprey](https://forum.kirupa.com/u/danoprey)
#### Post date: [December 10, 2008, 2:07pm UTC](https://forum.kirupa.com/t/run-different-functions-depending-on-domain/277301/1 "2008-12-10T14:07:22Z")

</div>

Is it possible to have one file, which behaves differently depending on which url it is displayed on?

e.g.

> 

var urlString:String;

urlString = getURL???

switch (urlString)  
{  
case [url1.com](http://url1.com):  
doThis();  
break;  
case [url2.com](http://url2.com):  
doThat();  
break;  
}
