Topic: Trouble with variables

I have written a short javascripot function to change the Xml path depending on user selection via a menu

a snippet is:

    if (picpath==1) {
        fo.addVariable("xmlDataPath",xml_1);   
    }
.....

    fo.write("flashcontent");   

In order to simplify the code I would like to construct the xml file name using the form "xml_" + a tring representation of a number. For example:
     picpath=0 [or an other number passed fromthe main routines]
     x=picpath.toString();
xmlpath="xml_"+x;

If I use the above routine or any variation on the theme that creates a string variable xmlpath containing xml_0 I receive a gallery not found error after the fo.write has happened.

If I use the first method above where the file name is hard-coded  it works fine.

am I missing soething about the nature or construct of the way the fo.write function works and the variable type/ormat the file name has to have?

Seems very strange that a typed-in string works and a viable doesn't. Unless the variable is padded with spaces perhaps?

Re: Trouble with variables

Don't forget to tack .xml on to the end of your string and add quotes, xmlpath="xml_"+x; should be xmlpath="'xml_"+x+".xml'";

Mike Richards
SimpleViewer Support Team.