This content has been marked as final. Show 7 replies
the base class set in your linkage dialog, for movieclips that are members of GamePiece, should be flash.display.MovieClip. is it?
no...its set to GamePiece (that extends MovieClip)...If I set it to flash.display.MovieClip I get an error....
1067: Implicit coercion of a value of type gameBall1 to an unrelated type GamePiece.
If I set the base class to GamePiece it works but seems to create an extra one that I never instanciate. Like its being called by itself when flash loads in the class descriptions.
gameBall1 is the class name of the symbol in the library. (the game piece animation) I have multiple different types but want to define all the functionallity of each one in the GamePiece class. That's why I use the GamePiece Class as the bass class for them. I actualy have everything working pretty much the way I want it to except for that extra instance that shows up when I run it. I don't understand how it gets called when I don't call it.
that's not right and that's why you're having some issues. either live with it because it's not causing much trouble or do it right: if you want the gameBall1 class to extend the GamePiece class set that up in your gameBall1 class.
oh, that is how I was told to do it. So I think I understand, so you can override the class that Flash creates automatically with the name used in the linkage properties for the symbol. So I create a gameBall1 class and extend GamePiece in there. Then for the base class in the linkage properties I use flash.display.MovieClip. Then to create it I would do this...
gp = new gameBall1;
Is that correct?
Just so I have a better understanding of what was going on under the hood...the problem I was having is that flash was automatically creating an instance of the GamePiece class because it was listed in the symbol linkage properties as the base class?
if your gameBall1 class is supposed to inherit from your GamePiece class, in gameBall1's class definition you should use: