# List box not working correctly

**URL:** <https://forum.kirupa.com/t/list-box-not-working-correctly/222360>\
**Category:** Uncategorized\
**Created:** [April 12, 2007, 6:18pm UTC](https://forum.kirupa.com/t/list-box-not-working-correctly/222360 "2007-04-12T18:18:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scot\_Juggles](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Scot\_Juggles](https://forum.kirupa.com/u/Scot_Juggles)\
**Post date:** [April 12, 2007, 6:18pm UTC](https://forum.kirupa.com/t/list-box-not-working-correctly/222360/1 "2007-04-12T18:18:57Z")

</div>

Hello everyone,  
I am going to be dynamically loading .swf files into a listbox to display them on my main page. My listbox populates fine, and proceeds to display the .swf files correctly when selecting the appropriate ones in my listbox. When I export in flash (by export I mean pressing [ctrl] + [enter]), everything works great. So pretty much everything is working good at this point. I then wrote the html page to display my flash file and now my event listener isn’t working and I can’t get the maps (.swf files) to change on my main page any more. I tested it in IE7 and FireFox, both with the same result. Here is the code that currently works when you export in flash 8, but fails when I embed the .swf file into an html page. My actionscripts (2.0) are as follows:

//initialize listener and set mapMenu labels and data  
var myListener:Object = new Object();  
mapMenu.addItem(“Garage”,“Garage.swf” );  
mapMenu.addItem(“Floor 1”,“Floor1.swf”);  
mapMenu.addItem(“Floor 2”,“Floor2.swf”);  
mapMenu.addItem(“Floor 3”,“Floor3.swf”);  
mapMenu.addItem(“Roof”,“Roof.swf”);  
mapMenu.addItem(“Perimeter”,“Perimeter.swf”);

svgMovie.loadMovie(“images/Floor1.swf”); //default to floor 1

myListener.change = function(obj) {  
svgMovie.loadMovie(“images/” + obj.target.selectedItem.data);  
trace(“images/” + obj.target.selectedItem.data);  
};

mapMenu.addEventListener(“change”, myListener);

I also tried:

function displayMap©{  
svgMovie.loadMovie(“images/” + c.getSelectedItem().data);  
trace(“images/” + c.getSelectedItem().data);  
}

mapMenu.setChangeHandler(“displayMap”);

which wont even work when I export it from flash.

Has anyone heard of a problem like this? I have been searching with little to no success. Any help would be greatly appreciated. Thanks. ~Scot
