# Concatenate variable name

**URL:** <https://forum.kirupa.com/t/concatenate-variable-name/244669>\
**Category:** Uncategorized\
**Created:** [November 20, 2007, 6:27pm UTC](https://forum.kirupa.com/t/concatenate-variable-name/244669 "2007-11-20T18:27:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesruiz](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@jesruiz](https://forum.kirupa.com/u/jesruiz)\
**Post date:** [November 20, 2007, 6:27pm UTC](https://forum.kirupa.com/t/concatenate-variable-name/244669/1 "2007-11-20T18:27:42Z")

</div>

Hi all!  
Here goes my first post on this forum. I’m trying to concatenate a name and variable number. Then trace it, so answer3 should output from my loaded xml data “water”. Instead all I can get to trace is the word “answer3”. If I type “answer3” in the trace I get the variable im looking for. If I type [this.getCorrectAnswerNumber()] in the trace I get number 3. How do I go about concatinating the word answer and a dynamic number.

Heres my code…

```auto

trace("answer"+[this.getCorrectAnswerNumber()]);

```

Thanks for your help,  
J
