# cs4 as2 using variable in file path

**URL:** <https://forum.kirupa.com/t/cs4-as2-using-variable-in-file-path/315063>\
**Category:** flash\
**Created:** [October 16, 2010, 3:38pm UTC](https://forum.kirupa.com/t/cs4-as2-using-variable-in-file-path/315063 "2010-10-16T15:38:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![j0101011](https://avatars.discourse-cdn.com/v4/letter/j/838e76/32.png) [@j0101011](https://forum.kirupa.com/u/j0101011)\
**Post date:** [October 16, 2010, 3:38pm UTC](https://forum.kirupa.com/t/cs4-as2-using-variable-in-file-path/315063/1 "2010-10-16T15:38:15Z")

</div>

ok so I have had this lil problem posted on another site and it stumped them so I figured I would bring it here.

I am using the mdm extension to build a skinable browser for Brym’s desktop hud application ([http://www.desktophud.com](http://www.desktophud.com))

I am loading variables from a text document to get the folder name and image type of the skin.

I use this code to load the variables

config = new LoadVars();  
config.load(“Browser skins/config.txt”);  
config.onLoad = function(success) {  
if (success) {  
// trace(success);  
[COLOR=Black][COLOR=#0000FF]skin\_output.text = this.selected\_skin+", "+this.skin\_method[/COLOR];[/COLOR]  
}  
};

I know it works cause I see the vars info in my text box.  
What I am having trouble with is the next bit

if (this.skin\_method == png) {  
//skin loading  
//nav and overlays  
loadMovie([COLOR=#0000FF]“Browser skins/”+this.selected\_skin+"/navbar/navbar.png"[/COLOR], navbar);

^ were selected\_skin = default-skin

and I have also tried

if (this.skin\_method == png) {  
//skin loading  
//nav and overlays  
loadMovie([COLOR=#0000FF]this.selected\_skin+"/navbar/navbar.png"[/COLOR], navbar);

^were selected\_skin = Browser skins/default-skin.

I also tried things like

var skinFolder = this.selected\_skin;

if (this.skin\_method == png) {  
//skin loading  
//nav and overlays  
loadMovie([COLOR=#0000FF]skinFolder+"/navbar/navbar.png"[/COLOR], navbar);

all of which give me this error were the variables return undefined.

file:///C|/Documents%20and%20Settings/Jaden/Desktop/hud/huds/undefined/navbar/navbar.png’

I am really stumped here and would be grateful for some pointers.
