ComboBox prob

Hi,

I’m pretty new to AS3 so you’ll have to excuse my lack of knowledge!

I’m building a media card calculator which has three levels of comboBox.

First the user chooses a size of card eg 2GB, 4GB, 8GB, 16GB
Next they choose the device eg camera, camcorder etc
Finally they choose the format of device eg 5, 10, 14 megapixels if it’s a camera, HD or non-HD if it’s a camcorder.

I’m having probs trying to get the final ComboBox to change it’s contents according to what was selected above (so if camera selected the change the box to , 10, 14 megapixels) . My codes is as follows:

 
deviceDrop.addEventListener(Event.CHANGE, deviceHandler);
 
deviceDrop.addItem({label:"Choose a device"});
deviceDrop.addItem({label:"Camcorder"});
deviceDrop.addItem({label:"Camera"});
deviceDrop.addItem({label:"MP3"});
 
function deviceHandler(event:Event):void {
 
 if (deviceDrop.text == "Camcorder"){
 formatDrop.addItem({label:"HD"});
 formatDrop.addItem({label:"Normal"});
 }
 else if(deviceDrop.text == "Camera"){
 formatDrop.addItem({label:"5 Megapixels"});
 formatDrop.addItem({label:"10 Megapixels"});
 formatDrop.addItem({label:"12 Megapixels"});
 formatDrop.addItem({label:"14 Megapixels"});
 }
 else if(deviceDrop.text == "MP3"){
 formatDrop.addItem({label:"MP3"});
 formatDrop.addItem({label:"AAC"});
 formatDrop.addItem({label:"WMA"});
 }
}

The result is that on the first click nothing happens, second click it had HD and Normal, third click add Megapixels and forth click add MP3 etc.

Hope this is enough info.

Any suggestions would be greatly appreciated

cheers,

matt