A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: how to use loadVariablesNum with a Variable.

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    14

    how to use loadVariablesNum with a Variable.

    I try to have the page in 2 languages. the htm files for german are in the folder ge/ and the ones for english in the folder /en

    lan = ge.

    Lets say default language is german. The Variable indicating the selected language is "ge" for german. Now when the user presses "english".. the variable (lan) will change to "en".

    I would like my loadVariables command to load the files with same name, but from the english folder. Like this:

    loadVariablesNum(lan+"/about.htm", 0)


    this should be the same as
    loadVariables("ge/about.htm", 0) <-- thats what i would like as result, but "ge" coming from the variable so i can change language.

    why does it not work?
    Thanks
    Sirus

  2. #2
    Flash programmer
    Join Date
    Jul 2005
    Location
    Sweden
    Posts
    48
    Well, I don't know if it just is a typo here, but you uses two different functions. loadVariablesNum and loadVariables don't do the exactly same thing.

    loadVariables loads the stuff into a movie clip and the loadVariablesNum into a level.

    I don't think that it is your problem though, do you got " around ge?
    This code works, but I guess its about the same as yours:
    Code:
    var lan;
    lan = "ge";
    loadVariablesNum(lan + "/about.htm", 0);
    Have a nice day - The Wazaa
    My portfolio

  3. #3
    Junior Member
    Join Date
    Feb 2006
    Posts
    14
    my variable was definded in _root. and i called in in a sub mc... ... .well, sorry and thanks.
    Sirus

  4. #4
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    _root code:

    var lan;
    lan = "ge";


    anywhere else code:
    loadVariablesNum(_root.lan + "/about.htm", 0);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center