# Setting and Concatenating Variable Values?

**URL:** <https://forum.kirupa.com/t/setting-and-concatenating-variable-values/6570>\
**Category:** flash\
**Created:** [October 10, 2002, 5:48pm UTC](https://forum.kirupa.com/t/setting-and-concatenating-variable-values/6570 "2002-10-10T17:48:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jOEL](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jOEL](https://forum.kirupa.com/u/jOEL)\
**Post date:** [October 10, 2002, 5:48pm UTC](https://forum.kirupa.com/t/setting-and-concatenating-variable-values/6570/1 "2002-10-10T17:48:37Z")

</div>

I’m calling a ColdFusion page that generates output in the form of a text file to be used in a scrolling dynamic text field.

So, Instead of calling a text file like so:

//calls a static text file  
loadText.load(“StaticTextFile.txt”);

Im calling a ColdFusion page like so:

//calls a Cold Fusion page that sends back a text file for the term “help”  
loadText.load(“flashGlossary.cfm?term=help”);

What I would like to do is have buttons in the Movie that will set the value of a variable named “term” and append it to the ColdFusion query string.

Here’s what I mean:

On a button I would set the variable:

//set the value of the variable “term” to “help”  
on (release) {  
term = “help”;  
}

Then later in the movie when I called the content for the text field, I need to tell it to append the value of “term” to the end of the ColdFusion query string.

//set the value of the variable “term” to “help”  
loadText.load(“flashGlossary.cfm?term=”+term);

But this does not work? Do I need a complete path for the variable (ie. \_root.MCInstance.term) or am I trying to concatenate this incorrectly? Or both 🙂

Any help would be trendously appreciated.

Thanx in advance

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 10, 2002, 5:52pm UTC](https://forum.kirupa.com/t/setting-and-concatenating-variable-values/6570/2 "2002-10-10T17:52:09Z")

</div>

your syntax is correct, so i’d say it’s the former; you need to path to your variable.

try tracing term in the same action to be sure of what you’re dealing with.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 10, 2002, 5:56pm UTC](https://forum.kirupa.com/t/setting-and-concatenating-variable-values/6570/3 "2002-10-10T17:56:23Z")

</div>

what do you mean by tracing term in the same action?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 10, 2002, 6:31pm UTC](https://forum.kirupa.com/t/setting-and-concatenating-variable-values/6570/4 "2002-10-10T18:31:34Z")

</div>

```auto
a=2;
trace(a);
//returns 2

```

Trace the variable you are sending (help or term, I don’t remember).

pom :hat:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 10, 2002, 6:35pm UTC](https://forum.kirupa.com/t/setting-and-concatenating-variable-values/6570/5 "2002-10-10T18:35:56Z")

</div>

Thanx guys!

Yes it is a path problem…I’m working on it to dial it in.

For the time being though it seems setting the variable to \_global.variablename is working - then I just call the variable by name late rin the movie.

thanx again guys, this forum rocks!
