# Problem loading XML inside switch

**URL:** <https://forum.kirupa.com/t/problem-loading-xml-inside-switch/151842>\
**Category:** Uncategorized\
**Created:** [June 18, 2005, 4:49pm UTC](https://forum.kirupa.com/t/problem-loading-xml-inside-switch/151842 "2005-06-18T16:49:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luiscguimaraes](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@luiscguimaraes](https://forum.kirupa.com/u/luiscguimaraes)\
**Post date:** [June 18, 2005, 4:49pm UTC](https://forum.kirupa.com/t/problem-loading-xml-inside-switch/151842/1 "2005-06-18T16:49:55Z")

</div>

Hi everyone!  
I’ve been working on a photo gallery using flash and xml.  
The generall idea is to have ONE swl that loads one of MANY xml files.  
I’m trying to select which one using a combobox.  
What happens is that if I try to load the file outside the switch clause like this:

```auto
 var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.load("file1.xml");

```

it works just fine!

But if I do it inside the switch like this:

```auto
 ... 
case 1 :
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.load("file1.xml");
break;
...

```

it just doesn’t work!  
I’ve done a trace inside the case to check that it gets there and it does, so I’m out of ideas… ☹

Anyone have any idea why this doesn’t work?

Thks in advance 😉
