类型错误:错误#1006:playContent不是一个函数 [英] TypeError: Error #1006: playContent is not a function

查看:162
本文介绍了类型错误:错误#1006:playContent不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有拥有另一个类的对象的类。当我要调用这个类中的一些功能,我得到了上面的错误...查看code,以获得更好的主意!

I have a class that holds an object from another class. When I want to call some function from this class, I get the above error... See code to get a better idea!

MainMenu.as

MainMenu.as

package portfolioSource  {      
    public class MainMenu extends MovieClip {

        private var movieContainer:MoviePlayerContainer;

        public function MainMenu() {

            movieContainer = new MoviePlayerContainer();
            this.addChild(movieContainer);

        }

        function ef_btnTheme1CLICK(event:Event){

            movieContainer.playContent(1);//It breaks here

        }           
    }       
}

和MoviePlayerContainer.as

and MoviePlayerContainer.as

package portfolioSource  {    
    public class MoviePlayerContainer extends MovieClip {   

        public function playContent(_parameter:Number){

            trace("I do not work");

        }
    }

}

这是我在做什么错的任何想法?不是在movieContainer对象的工作职能之一。每次我得到同样的错误。构造函数(略)没有得到执行,但不会产生错误...

Any ideas on what I'm doing wrong? Not one of the functions in the movieContainer object works. I get the same error every time. The constructor (omitted here) does not get executed, but it generates no error...

当我删除软件包的一部分,离开它默认这样的:

When I remove the package part and leave it default like :

package {
    public class someClass{
    }
}

然后,它的工作原理。因此,我现在真的很迷茫。

Then it works. So I am really confused now.

谢谢!

推荐答案

看起来你有2个班被定义在不同的软件包的名称相同。您应该删除或重命名其中的一个。

It looks like you have 2 classes being defined with the same name on different packages. You should remove or rename one of them.

我不知道如果Flash支持这一点,但看看这个作品:私人变种movieContainer:portfolioSource.MoviePlayerContainer;

I'm unaware if Flash supports this, but see if this works: private var movieContainer : portfolioSource.MoviePlayerContainer;

这篇关于类型错误:错误#1006:playContent不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆