开发者

EventListener function in parent class

I have class ShowCase that inherite from my class ContentMC (that inherite from MovieC开发者_运维知识库lip). In the class ShowCase I have an EventListner that calls a function in the parent class ContentMC. But I get an error that says "Access of undefined property restoreMenuItem".

This is my eventlistner in ShowCase.as.

showcaseItem.addEventListener("CONTENTMCCLOSED", restoreMenuItem); 

Here I get the error, it doesn't find the function restoreMenuItem.

The function restoreMenuItem is in ContenMC and looks like this.

public function restoreMenuItem(evt:Event):void
        {

}

How do I call this function that's in the parent?

Thanks, Vincent


Use super statement.

showcaseItem.addEventListener("CONTENTMCCLOSED", super.restoreMenuItem); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜