# Multi-language website (5006 error)

**URL:** <https://forum.kirupa.com/t/multi-language-website-5006-error/295563>\
**Category:** flash\
**Created:** [September 1, 2009, 12:11pm UTC](https://forum.kirupa.com/t/multi-language-website-5006-error/295563 "2009-09-01T12:11:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jarno](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@Jarno](https://forum.kirupa.com/u/Jarno)\
**Post date:** [September 1, 2009, 12:11pm UTC](https://forum.kirupa.com/t/multi-language-website-5006-error/295563/1 "2009-09-01T12:11:19Z")

</div>

Hi,

I’m new here and I’m new to AS(3).  
I’m trying to make a multi-language website with XML. Here is my code:  
ActionScript Code:

```auto
    
[LEFT]package [COLOR=#000000]{[/COLOR]
    [COLOR=#000000] **var** [/COLOR] xmlData:[COLOR=#0000ff]XML[/COLOR];
    [COLOR=#000000] **var** [/COLOR] xmlLoader:URLLoader = [COLOR=#000000] **new** [/COLOR] URLLoader[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];

    xmlLoader.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]Event.[COLOR=#000080]COMPLETE[/COLOR], LoadXML[COLOR=#000000])[/COLOR];
    xmlLoader.[COLOR=#0000ff]load[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000] **new** [/COLOR] URLRequest[COLOR=#000000]([/COLOR][COLOR=#ff0000]"nederlands.xml"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];

    [COLOR=#000000] **function** [/COLOR] LoadXML[COLOR=#000000]([/COLOR][COLOR=#0000ff]e[/COLOR]:Event[COLOR=#000000])[/COLOR]:[COLOR=#0000ff]void[/COLOR] [COLOR=#000000]{[/COLOR]
        xmlData = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]XML[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]e[/COLOR].[COLOR=#0000ff]target[/COLOR].[COLOR=#0000ff]data[/COLOR][COLOR=#000000])[/COLOR];
        page1.[COLOR=#000080]txt_home_titel[/COLOR].[COLOR=#0000ff]text[/COLOR] = xmlData.[COLOR=#0000ff]home[/COLOR].[COLOR=#000080]titel[/COLOR];
        page1.[COLOR=#000080]txt_home_tekst[/COLOR].[COLOR=#0000ff]text[/COLOR] = xmlData.[COLOR=#0000ff]home[/COLOR].[COLOR=#000080]tekst[/COLOR];
    [COLOR=#000000]}[/COLOR]

    nl_btn.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]CLICK[/COLOR], taalNederlands[COLOR=#000000])[/COLOR];
    en_btn.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]CLICK[/COLOR], taalEngels[COLOR=#000000])[/COLOR];

    [COLOR=#000000] **function** [/COLOR] taalNederlands[COLOR=#000000]([/COLOR][COLOR=#0000ff]e[/COLOR]:MouseEvent[COLOR=#000000])[/COLOR]:[COLOR=#0000ff]void[/COLOR] [COLOR=#000000]{[/COLOR]
        xmlLoader.[COLOR=#0000ff]load[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000] **new** [/COLOR] URLRequest[COLOR=#000000]([/COLOR][COLOR=#ff0000]"nederlands.xml"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#000000] **function** [/COLOR] taalEngels[COLOR=#000000]([/COLOR][COLOR=#0000ff]e[/COLOR]:MouseEvent[COLOR=#000000])[/COLOR]:[COLOR=#0000ff]void[/COLOR] [COLOR=#000000]{[/COLOR]
        xmlLoader.[COLOR=#0000ff]load[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000] **new** [/COLOR] URLRequest[COLOR=#000000]([/COLOR][COLOR=#ff0000]"engels.xml"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]

    volgende_btn.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]CLICK[/COLOR], volgende[COLOR=#000000])[/COLOR];
    [COLOR=#000000] **function** [/COLOR] volgende[COLOR=#000000]([/COLOR][COLOR=#0000ff]e[/COLOR]:MouseEvent[COLOR=#000000])[/COLOR]:[COLOR=#0000ff]void[/COLOR] [COLOR=#000000]{[/COLOR]
        [COLOR=#0000ff]nextFrame[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]

```

[/LEFT]

It works, as long as I put it on the timeline. The only problem then is that I can’t change the language when I’m on frame 2.  
Someone advised me to put it in an extern AS file, but when I do that I get the following error:  
_5006: An ActionScript file can not have more than one externally visible definition: xmlData, xmlLoader_

I don’t really know what that means, I hope somebody can help me out. 🙂

Also I’d like to know if this is the best way to make a multi-language website in Flash?
