"1120: Access of undefined property" error, need help with howto

I’m struggling to adapt to AS3… I was an AS2 hack and now I’m paying for it.

I’ve tried set up a function to toggle the visiblity on an MC that gets created at runtime. Obviously the compiler wants that movieclip to be there to validate the code before I want the MC to be there. I think.

So, how do I go about setting a toggle on an MC’s visiblity from a keystroke in AS3?

Thanks!

Jeb