[]分包项目, 加载js时报错

zip中, AA和BB是两个项目, AA调BB分包生成的JS,  AS为引擎文件夹,  这3个都在桌面上,  麻烦帮我查看一下, 为什么会报错:
 
 
Uncaught TypeError: Cannot read property 'View' of undefined
    at eval (eval at __proto.complete (AA.max.js:410), <anonymous>:5:68)
    at eval (eval at __proto.complete (AA.max.js:410), <anonymous>:24:3)
    at eval (<anonymous>)
    at AA.__proto.complete (AA.max.js:410)
    at EventHandler.__proto.runWith (AA.max.js:674)
    at ResInfo.__proto.event (AA.max.js:453)
    at LoaderManager.__proto._endLoad (AA.max.js:9492)
    at Loader.onLoaded (AA.max.js:9469)
    at EventHandler.__proto.runWith (AA.max.js:674)
    at Loader.__proto.event (AA.max.js:453)
已邀请:

sevennqi

赞同来自:

这个是我改成extends Box:
 package
{
    import laya.ui.Box;
    import laya.display.Text;
    import laya.ui.View;

    /*[COMPILER OPTIONS:ForcedCompile]*/
    public class loading100 extends Box
    {
        public function loading100()
        {
            var txt:Text = new Text();
            //设置文本内容
            txt.text = "Hello Layabox2";
            //设置文本颜色为白色,默认颜色为黑色
            txt.color = '#ffffff';
            this.addChild(txt);
            
            var v:View = new View();
            v.graphics.drawCircle(50, 50, 100, "#000000");
            v.pos(100, 100);
            this.addChild(v);
        }
    }
}
 
然后, 报错就在Box上:
Uncaught TypeError: Cannot read property 'Box' of undefined
    at eval (eval at __proto.complete (Main.max.js:308), <anonymous>:5:17)
    at eval (eval at __proto.complete (Main.max.js:308), <anonymous>:26:3)
    at eval (<anonymous>)
    at Main.__proto.complete (Main.max.js:308)
    at EventHandler.__proto.runWith (Main.max.js:6746)
    at ResInfo.__proto.event (Main.max.js:348)
    at LoaderManager.__proto._endLoad (Main.max.js:9322)
    at Loader.onLoaded (Main.max.js:9299)
    at EventHandler.__proto.runWith (Main.max.js:6746)
    at Loader.__proto.event (Main.max.js:348)
 

cuixueying

赞同来自:

你的继承错了吧,改成Box后在编译一次看看,你js代码继承的是sprite,项目里继承的是Box!

要回复问题请先

商务合作
商务合作