Function not running in a class

Hey guys,
I’ve got a bit of an odd issue. I have a class called UIObject that has a private property called _id. I have a getter/setter for it, and I extend UIObject by a class, lets say, MenuButton. Inside of MenuButton I have this function:

public function create($id:Number):Void
    {
        this.id    = $id;
        trace("=====> create");
    }

now, I have a Main class that activates my MenuButtons, and that code is here:


private function initMainMenu():Void
    {
        for (var i:Number = 0; i < 6; i++)
        {
            var ob:Object = new Object();
            ob.mc = this.menu_mc["item" + i + "_mc"];
            ob.mc.create(i);
            
            ob.mc.onRelease = function():Void
            {
                trace(this.id);
            };
        }
    }

I’ve used this code successfully in the past, but for some reason my past two projects, it has not worked and create never gets run. I’ve tried time and time again to figure out why this isn’t working all of a sudden, but I can’t. I imagine i’m missing some very small detail and I need someone to point it out to me. Any help is greatly appreciated. Thanks.

  • Matt