Working w/ComboBox and Arrays, having trouble passing a variable to DataProvider

Hi,

I’m trying to use a multidimensional array to dynamically populate a combobox. I’m trying to pass a variable, (whichLesson), from the constructor function to the DataProvider value field that resides in another function (initMenu). if I type in the value I want like so:

  var dp:DataProvider = new DataProvider(menuItems.lesson1);

it works fine… but when I replace the ‘lesson1’ with the variable name I’m trying to reference I get an empty combobox… no error messages… just an empty box. I’ve traced the variable and the information is being passed into the function. It’s just not registering it in the DataProvider field. Here’s my code:

 
public function HPSE_Main():void {
            initMenu("lesson1");
            menuTitles();
            loadMain();
            menuStyle();
        }
        private function initMenu(whichLesson):void {
            var menuItems:Array = new Array();
            menuItems["lesson1"] = ["1. Lesson 1 Introduction"]; 
            menuItems["lesson2"] = ["1. Lesson 2 Introduction"];
            menuItems["lesson3"] = ["1. Lesson 3 Introduction"];
            menuItems["lesson4"] = ["1. Lesson 4 Introduction"];
            menuItems["lesson5"] = ["1. Lesson 5 Introduction"];
            menuItems["lesson6"] = ["1. Lesson 6 Introduction"];
            menuItems["lesson7"] = ["1. Lesson 7 Introduction"];

            var dp:DataProvider = new DataProvider(menuItems.whichLesson);
            mainInterface.pageMenu.dataProvider = dp;
            trace(whichLesson);
        }

Thanks in advance!