How to Make Pull-Down Menus in Flash

I am trying to build a simple flash pull-down menu; found this on another forum and followed the example to a tee:

stop();

function item_Select() {
if (ChooseItems.getValue() == “item1”) {
gotoAndStop(2); //Change this line to what you want the dropdown to do
} else if (ChooseItems.getValue() == “item2”) {
gotoAndStop(3);
}else if (ChooseItems.getValue() == “item3”) {
gotoAndStop(4);
}else if (ChooseItems.getValue() == “item4”) {
gotoAndStop(5);
}
}

…although when i test it out i get this back:

Scene=Scene 1, Layer=layer1, Frame=2: Line 20: Statement must appear within on/onClipEvent handler
function item_Select() {

i know the solution is simple but i’m new to flash and still trying to get the hang of the language and scripting. what’s wrong?