# Function return URLVariables?

**URL:** <https://forum.kirupa.com/t/function-return-urlvariables/286591>\
**Category:** Uncategorized\
**Created:** [April 17, 2009, 1:14pm UTC](https://forum.kirupa.com/t/function-return-urlvariables/286591 "2009-04-17T13:14:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThaJock](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@ThaJock](https://forum.kirupa.com/u/ThaJock)\
**Post date:** [April 17, 2009, 1:14pm UTC](https://forum.kirupa.com/t/function-return-urlvariables/286591/1 "2009-04-17T13:14:22Z")

</div>

Is there a way to return URLVariables from a function

eg:

function varsLoaded():[COLOR=Red]URLVariables[/COLOR] {  
[COLOR=Blue]var[/COLOR] variables:URLVariables = new URLVariables();  
variables.var1 = ‘string1’;  
variables.var2 = ‘string2’;  
[COLOR=Red]return[/COLOR] variables;  
}

Now what I would like to do is assign “variables” to a variable:  
[COLOR=Blue]var[/COLOR] theVar = varsLoaded();  
trace(theVar.var1);

Obviously the code above isn’t correct; just to illustrate what I’m hoping to accomplish. Any help would be greatly appreciated.
