Why does Flash CS3 require you to specify the base class when exporting for actionscript (as3)?

In the library, right-click the movie clip you wrote the ActionScript class in and choose Linkage .... Please note that the "Base class" field is not empty (it cannot be). It probably will flash.display.MovieClip

, but it could be something different, depending on what your class inherits. This base class field is required only when publishing for ActionScript 3.

So can anyone tell me why Flash CS3 insists that I provide the base class in both the ActionScript file and the Linkage dialog? If the base class is different between the two locations, it can still be posted without errors and the Linkage dialog just seems to be ignored (as long as it is valid).

What is the point of the base class field ??

0


source to share


3 answers


I use it a lot, so I set the same base class for multiple objects without creating a separate .as file class for them. This is useful when you are doing more of a graphical type and do not need separate classes, but need to be created programmatically.



I don't know why this allows you to set the wrong parameters here, I suspect this is a legacy from a very "relaxed view" when typing Flash IDEs have always had.

+2


source


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



The default base class value is flash.display.MovieClip. Use this default unless you are using an auto-generated class that uses the functionality of the outer class. The base class is not singular with extension; if you specify your own class that itself extends another class, there is no need to specify that superclass as the base class . In this situation, the default is flash.display.MovieClip. If, however, you wanted the two symbols RedFish and BlueFish to function the same but have different skins, you could use the creation tool to create different phenomena, and then set their base class to Fish and use the Fish class in the external Fish.as file to providing functionality for both fish.

+1


source


Well, it could be a button, Sprite, MovieClip, or any other display object. You just create a special version of one of them. You need to provide Flash with the type you are creating.

0


source







All Articles