Access of possibly undefined property

In the document class of my flash file, a variable is declared called “firstSound”. I’m trying to access this variable inside a movieclip sitting on the main timeline. However, I get an error when I try this:

trace(MovieClip(root).firstSound);

Error: 1119: Access of possibly undefined property firstSound through a reference with static type flash.display.DisplayObjectContainer.

Why am I getting this error?

You’re coding inside a movieclip on the stage? Or did I misunderstand you. : )

Yes, the script is located within the movieclip’s timeline, and the movieclip itself is on the stage.