0
votes

I've got these two errors: Scene 1, Layer 'Layer 1', Frame 1, Line 6 1046: Type was not found or was not a compile-time constant: Basics. Scene 1, Layer 'Layer 1', Frame 1, Line 6 1180: Call to a possibly undefined method Basics.

I've searched around but I can't find a solution for this problem. So here's the code, I hope you guys can help me.

import ShowText;
import Game;
import flash.events.MouseEvent;

var basics:Basics = new Basics();

And the called code is

package 
{
    import flash.display.MovieClip;
    import flash.events.Event;
    import as3isolib.display.primitive.IsoBox;
    import as3isolib.display.IsoView;
    import as3isolib.display.scene.IsoScene;
    import as3isolib.display.scene.IsoGrid;

    public class Basics extends MovieClip {
        public function Basics() {
            var view:IsoView = new IsoView();
            view.setSize((stage.stageWidth), stage.stageHeight);
            view.clipContent = true;
            addChild(view);

            var gridHolder:IsoScene = new IsoScene();
            view.addScene(gridHolder);

            scene = new IsoScene();
            view.addScene(scene);

            var grid:IsoGrid = new IsoGrid();
            grid.cellSize = 40;
            grid.setGridSize(5, 5, 0);
            gridHolder.addChild(grid);

            var box:IsoBox = new IsoBox();
            box.setSize(40, 40, 40);
            box.moveTo(80, 80, 0);
            scene.addChild(box);

            gridHolder.render();
            scene.render();
        }
    }
}

I do not see where the problem is.

1

1 Answers

0
votes

EDIT: Just realised that your first snippet appears to be code you have entered on the timeline! Instead, use something similar to what I posted and set that class to be the Document Class of your project.

You haven't imported the "Basics" class nor does that snippet look like a valid AS3 class definition:

import ShowText;
import Game;
import flash.events.MouseEvent;

var basics:Basics = new Basics();

Would something similar to the following work:

package {

    import Basics;
    import flash.display.MovieClip;

    public class Main extends MovieClip
    {
         public function Main()
         {
             var basics:Basics = new Basics();

             addChild(basics);
         }
    }
}