TypeError: Error #1010: A term is undefined and has no properties

Please help,

TypeError: Error #1010: A term is undefined and has no properties.
at Tbutton()[C:\Projects\IP Panel\Tbutton.as:23]
at Panel_fla::0_1/frame1()[Panel_fla.0_1::frame1:5]

Below is the constructor from a class which I instantiate in button symbols. Line 23 is marked. It calling a function from a class which is instantiated on the main timeline. I am passing the root reference to the constructor. I could not figure out how to reference the panel.RegListeners any other way.

It all works fine when debugging inside CS3 but when deployed and tested using the debug flash player fails with the above error

public function Tbutton(_this,_stage):void
{
holder = _stage;
button = _this;
// holder.dispatchEvent(new PanelEvents(PanelEvents.STATE_CHECK, port, channel, “”));
23. holder.panel.RegListeners(button);
trace("Holder= " + holder)
trace("Button= " + button)
RegListeners(button);
getParameters();
} // end constructor

holder and _stage are the typecasted root MovieClip(root) which are passed to the constructor.

the function that is being called is below it is in a class which is instantiated on the main timeline:

    public function RegListeners(sender:MovieClip)
    {
        sender.addEventListener(PanelEvents.BUTTON_PUSH, buttonPush);
        sender.addEventListener(PanelEvents.BUTTON_RELEASE, buttonRelease);
    }

Thank in advance

Matt