Importing classes in AS2 when compiling with MTASC

643 views Asked by At

I'm trying to compile a project I'm working on in AS2 using MTASC. However, I'm having some issues with importing some of my classes. My directory structure is as follows:

assets
--MouseTrail.fla
bin
--MouseTrail.swf
src
--MouseTrail
----Interface.as
----Main.as

Main.as

class MouseTrail.Main extends MovieClip
{
    public static function main(root:MovieClip)
    {
        root.__proto__ = Main.prototype;
    }
}

Interface.as

import MouseTrail.Main;

class MouseTrail.Interface extends MouseTrail.Main
{
    public function Interface(root:MovieClip)
    {
       super(root); 
       start();
    }

    private function start():Void
    {
        lineStyle(1, 0, 100);
        lineTo(100, 100);
    }
}

The command I'm using to compile my classes is:

mtasc ~/Desktop/mousetrail/src/MouseTrail/* -swf ~/Desktop/mousetrail/bin/mouseTrail.swf

However, I'm receiving the following error:

Desktop/mousetrail/src/MouseTrail/Interface.as:4: lines 4-21 : type error class not found : MouseTrail.Main

It seems I can't import the classes I need from my MouseTrail lib.

Could anyone provide some help to get this working?

Thanks

1

There are 1 answers

0
caubry On BEST ANSWER

This issue was resolved by using this command line:

mtasc ~/Desktop/mousetrail/src/MouseTrail/Interface.as -swf ~/Desktop/mousetrail/bin/mouseTrail.swf -out ~/Desktop/mousetrail/bin/mouseTrailTest.swf -cp ~/Desktop/mousetrail/src

VALUES

-swf Input .swf

-out Output .swf

-cp Classes root folder