Why is "Key.isDown()" not working?

Hi! I’m building up an image resize gallery (thank you scotty!), and I want to navigate using the left and right arrow keys on my keyboard.

I’ve been trying to figure this out a while now, but I can’t get it working. Can anybody help me out?

Here’s my code:


myIdentifier = Math.round(Math.random()*10000);
gallery_xml.load("gallery.xml?uniq="+myIdentifier, 1);
Key.isDown(LEFT); {
cur--;
if (cur<0) {
containerMC.loadPic(pArray.length-1);
} else {
containerMC.loadPic(cur);
}
};
Key.isDown(RIGHT); {
cur++;
if (cur>pArray.length-1) {
containerMC.loadPic(0);
} else {
containerMC.loadPic(cur);
}
};