flashactionscript-3classradixcs3

Why can't Flash CS3 find the MovieClip base class even after classpath is set (AS3)?


Tearing my hair out. I created an as3 class - blah.Foo, which extends MovieClip. it is not in a package, cos Flash CS3 complained about nested packages, so it's a 'bare' class.

And yes it's nested in myproj/as/blah/Foo.as And yes, it imports flash.display.MovieClip at the top of the file.

I also have myproj/fla/main.fla. main.fla is set to publish as AS3 against flash player 9. main.fla has classpath which includes myproj/as/

on frame1 scene1 in main.fla:

import blah.Foo;
var myfoo:Foo = new Foo();
stop();

compiler dies at class definition of Foo in Foo.as:

import flash.display.MovieClip;
class blah.Foo extends MovieClip //<=== dies here
{
    //whatever...
}

It complains that: "1017: The definition of base class MovieClip was not found".

Someone please help! How can it not find one of the most basic classes in AS3?!!


Solution

  • Actionscript 3.0 doesn't work like AS2

    try this

    package blah
    {
        import flash.display.Movieclip;
    
        public class Foo extends MovieClip
        {
        ...
    

    have a read

    hope this helps.