Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Aug 15, 2013 Aug 15, 2013

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 );

        }

    }

}

TOPICS
ActionScript
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 15, 2013 Aug 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 15, 2013 Aug 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/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 15, 2013 Aug 15, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 16, 2013 Aug 16, 2013

Did you look at the tutorial that I'm following?  I've only been doing AC3 and Flash for 2 weeks, so cut me some slack   Where I get hung up is when I made the new class DocumentClass and I try to connect the PlayScreen symbol to it.  That's where I get the message "The base specified is a native class and will be defined in the player at runtime.  It cannot be edited" when I try to enter in base class "flash.display.MovieClip".  I'm not trying to integrate DocumentClass with AvoiderGame - I know that doesn't make any sense.

It's under the heading "Adding a Game Screen" and "A New Class of Document" in the tutorial (not video).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2013 Aug 16, 2013

i didn't read that tutorial.

if you want to wait to see if someone else will read that tutorial and help you, ignore the rest of this message.

from your message 2, "My main document class is something different, called AvoiderGame.as."

the code below is from your first message and indicates you're trying to instantiate AvoiderGame:

package

{

    import flash.display.MovieClip;

    public class DocumentClass extends MovieClip

    {

        public var playScreen:AvoiderGame;

        public function DocumentClass()

        {

            playScreen = new AvoiderGame();

            addChild( playScreen );

        }

    }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 16, 2013 Aug 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 );

        }

    }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2013 Aug 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."

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 16, 2013 Aug 16, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 17, 2013 Aug 17, 2013

Thank you Amy - that's much clearer.  Like I said, I've only been doing this for a couple weeks for a class, so I'm VERY green.  I'll try that and get back to you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 18, 2013 Aug 18, 2013

Okay, it's telling me when I do that, that I have to a unique class name not associated with other library symbols.  AvoiderGame is the class associated with my other library symbols and PlayScreen will be on a different class.  Basically, I want to split the Game Over screen and PlayScreen on the Document Class and the the AvoiderGame class will pull in the enemies and avatar and control them, and also control the game timer.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 19, 2013 Aug 19, 2013
LATEST

If your Library symbols have AvoiderGame in their base class field, then the "Class" field should automatically be filled in with the name of the symbol, unless you already filled it in with something else. If you filled it in with something else, just copy the name of the symbol and paste it into the Class field and paste your custom Class into the Base Class field (the one at the bottom). When you use the Base Class field, it allows you to use your custom Class for multiple Library Symbols, because the Class name being used to form the linkage is the other field (Class).

To use a symbol, you'd do something like:

public class DocumentClass extends MovieClip {

     protected var game:AvoiderGame;

     public function DocumentClass() {

          super();

          game = new YourLibrarySymbolName() as AvoiderGame;

          addChild(game);

     }

}

Note that at this point it sounds like you're totally not following the tutorial, because Michael said pretty clearly that he was using the AvoiderGame Class as his Document Class, but you know--whatever. It's just not really possible to give you very good help, because it's impossible to determine if you've diverged from the tutorial on purpose, because you know what you're doing, on purpose, because you think you know what you're doing, but don't, or accidentally, because you don't understand what you're reading.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines