# How do I convert this String to a variable?

**URL:** https://forum.kirupa.com/t/how-do-i-convert-this-string-to-a-variable/271886
**Category:** flash
**Created:** [September 30, 2008, 2:18am UTC](https://forum.kirupa.com/t/how-do-i-convert-this-string-to-a-variable/271886 "2008-09-30T02:18:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nlyttle](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@nlyttle](https://forum.kirupa.com/u/nlyttle)
#### Post date: [September 30, 2008, 2:18am UTC](https://forum.kirupa.com/t/how-do-i-convert-this-string-to-a-variable/271886/1 "2008-09-30T02:18:01Z")

</div>

First I’m defining the location of my external SWFs to be loaded like this:

var sec1:String = “projects.swf”;  
var sec2:String = “news.swf”;

and so on…

then on my button functions I tried:

var loadSection = [“sec”+linkClicked];  
container.loadMovie(loadSection);

(each button has it’s own id called linkClicked)  
but Flash is trying to load a movie called “sec1”, not the variable sec1.

Thanks!
