Need help convert reverse mc function as2 to as3

I need to convert reverseMask function to as3 cause my component need as3…
this as2 script run perfectly

function reverseMask(mc)
{
    mc.createEmptyMovieClip("frameControler", 123);
    mc.frameControler.onEnterFrame = function ()
    {
        var _loc2 = this._parent;
        if (_loc2._currentframe > 1)
        {
            _loc2.prevFrame();
        }
        else
        {
            delete _loc2.onEnterFrame;
        } // end else if
    };
} // End of the function

and then i put this in timeline to begin function

reverseMask(maska);

there are multiple mask that i want to reverse

Please Help Me :*(. i need as3 script cause I’ve tried every way but can’t get my as3 working…