views:

1036

answers:

2

In the library, right-click on a movieclip that you have written an ActionScript class for and select "Linkage...". Notice that the "Base class" field is not empty (it can't be). It's likely to be flash.display.MovieClip, but it could be something else, depending on what your class inherits from. This base class field is only required when publishing for ActionScript 3.

So can anyone tell me why Flash CS3 insists on me providing the base class in both the ActionScript file and the Linkage dialog? If the base class differs between the two locations, it can still be published without errors, and the Linkage dialog just seems to be ignored (as long as it's valid).

What is the point of the Base class field!?

+2  A: 

I often use it so set the same base class for multiple objects without creating separate class .as files for them. It's useful when you're doing more graphical type stuff and don't really need separate classes, but do need to create them programatically.

I don't know why it allows you to set incorrect parameters here, I suspect it's an heritage from the very "relaxed view" on typing the Flash IDE always had.

grapefrukt
A: 

From: http://www.adobe.com/devnet/flash/quickstart/external_files_as3/

The value of the Base Class defaults to flash.display.MovieClip. Use this default unless you are using an automatically generated class that uses the functionality of an external class. Base Class is not synonomous with extension; if you are specifying a custom class that itself extends another class, it is not necessary to specify this superclass as the Base Class. In this situation, the default of flash.display.MovieClip is sufficient. If, however, you wanted two symbols, RedFish and BlueFish, to function identically but have different skins, you could use the authoring tool to create different appearances, then set their Base Class to Fish and use a Fish class in an external Fish.as file to provide the functionality for both fish.

Triynko