Skip to main content
Participating Frequently
August 15, 2013
Question

AC3 "The base specified is a native class..."??

  • August 15, 2013
  • 2 replies
  • 1812 views

Hello, I'm having a problem with linking one of my symbols to my document class.  I went under Properties in my symbol drop-down list and put the correct base class in their (flash.display.MovieClip), however it keeps giving me this error when I click to see if it goes through: The base specified is a native class and will be defined in the player at runtime.  It cannot be edited".  When I went back to check my code, it had the correct "public class DocumentClass extends MovieClip" under "import flash.display.MovieClip".  What am I doing wrong?  I'm pretty new to Flash and AC3..

package

{

    import flash.display.MovieClip;

    public class DocumentClass extends MovieClip

    {

        public var playScreen:AvoiderGame;

       

        public function DocumentClass()

        {

            playScreen = new AvoiderGame();

            addChild( playScreen );

        }

    }

}

This topic has been closed for replies.

2 replies

Amy Blankenship
Brainiac
August 16, 2013

You don't need to set flash.display.MovieClip as a base class (this happens automatically when you check "Export for Actionscript"). However, if you do set that as the Base Class for a library symbol, you shouldn't set a custom AS Class as the Class. Try setting your custom Class as the Base Class and just using the symbol name as the Class (linkage).

Note that it doesn't look like your main document Class is actually called AvoiderGame.

package

{

    import flash.display.MovieClip;

    public class DocumentClass extends MovieClip//this is your main document Class

    {

        public var playScreen:AvoiderGame;//this is a Class that looks like it is associated with a library symbol

       

        public function DocumentClass()

        {

            playScreen = new AvoiderGame();

            addChild( playScreen );

        }

    }

}

kglad
Community Expert
August 16, 2013

is that different from:

"however, it does make sense to change your document class to DocumentClass and assign your library symbol to have class = AvoiderGame.  i'm not sure that will do what you want but it's, at least, logical."

Amy Blankenship
Brainiac
August 17, 2013

Sometimes when people didn't understand one set of words, they will understand the same concept if it's rephrased, especially if there is other information added

kglad
Community Expert
August 15, 2013

you can't assign the document class to a movieclip in your library.  is that what you're trying to do?

ie, if DocumentClass is your document class, it can't be assigned to any other object.

ErinCFAuthor
Participating Frequently
August 15, 2013

My main document class is something different, called AvoiderGame.as.  This .as class is for my Playscreen and eventually my avatar and enemy.  If it makes it easier to understand, I am following this tutorial but it doesn't say anything about this problem, which I assume was not a problem in earlier versions of Flash:


http://gamedev.michaeljameswilliams.com/2008/10/09/avoider-game-tutorial-3/

kglad
Community Expert
August 16, 2013

that makes no sense.

you have a movieclip in your library with class = DocumentClass and in that class you try to instantiate your document class = AvoiderGame???

if that's true it couldn't be more wrong. 

however, it does make sense to change your document class to DocumentClass and assign your library symbol to have class = AvoiderGame.  i'm not sure that will do what you want but it's, at least, logical.

you could test that to see if that does what you want.  if it does not do what you want, you need to explain exactly what you want to do.