Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Flash Developer Center / Flash Professional glossary /

Flash glossary: Base class

by Adobe

Adobe Flash Professional

Created

25 July 2010

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
ActionScript Flash Professional OOP

In Adobe Flash Platform content development, a base class is the ActionScript class that other classes use for a primary set of properties and methods.

For symbols in Adobe Flash Professional, the value of the base class defaults to flash.display.MovieClip. For scripting a custom ActionScript class in Flash Professional or Adobe Flash Builder, the value of the base class defaults to flash.display.Sprite. Use these defaults unless you are using an automatically generated class that uses the functionality of an external class. Base class is not synonymous 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.

However, if you wanted two symbols named GreenCar and BlueCar to function identically but use different skins, you could use the drawing tools to create different appearances, then set their base class to Car and use a Car class in an external Car.as file to provide the functionality for both cars.

When making a custom class, create an external file with the structure of an automatically generated class, and then add the appropriate properties and methods to the class.

Inheritance is a form of code reuse that allows programmers to develop new classes that are based on existing classes. The existing classes are often called base classes or superclasses, while the new classes are called subclasses. A key advantage of inheritance is that it allows you to reuse code from a base class yet leave the existing code unmodified.

Additionally, inheritance requires no changes to the way that other classes interact with the base class. Rather than modifying an existing class that may have been thoroughly tested or may already be in use, using inheritance you can treat that class as an integrated module that you can extend with additional properties or methods. You use the extends keyword to indicate that a class inherits from another class.

Below is an overview of the DisplayObject class in the ActionScript 3 Reference for the Adobe Flash Platform:

file

The DisplayObject documentation shows that it uses the EventDispatcher class as its base class, and also that several classes (listed as "subclasses") use DisplayObject as their base class. Because the DisplayObject class inherits methods and properties from the EventDispatcher class, and the EventDispatcher class uses the Object class as its base class, the DisplayObject class also inherits properties and methods from the Object class through the inheritance chain.

Inheritance also allows you to take advantage of polymorphism in your code. Polymorphism is the ability to use a single method name for a method that behaves differently when applied to different data types. A simple example is a base class named Shape with two subclasses named Circle and Square. The Shape class defines a method named area(), which returns the area of the shape. If polymorphism is implemented, you can call the area() method on objects of type Circle and Square and have the correct calculations done for you. Inheritance enables polymorphism by allowing subclasses to inherit and redefine, or override, methods from the base class.


Tool used

  • Actions panel

Related concepts

  • ActionScript
  • Class

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

More Like This

  • Creating ActionScript 3.0 components in Flash – Part 8: Keyboard support
  • Controlling the appearance of text elements with the Text Layout Framework
  • Deconstructing the ActionScript 3 Flash video gallery application
  • Examining the Puzzle Game sample application
  • Authoring mobile Flash content for multiple screen sizes
  • Augmented reality using a webcam and Flash
  • Filtering XML data in Flash applications using ECMAScript for XML
  • Formatting text for localized Flash projects
  • Skinning the ActionScript 3 FLVPlayback component
  • Creating the Kuler panel for Flash CS3 Professional

Flash User Forum

More
04/23/2012 Auto-Save and Auto-Recovery
04/23/2012 Open hyperlinks in new window/tab/pop-up ?
04/21/2012 PNG transparencies glitched
04/01/2010 Workaround for JSFL shape selection bug?

Flash Cookbooks

More
02/13/2012 Randomize an array
02/11/2012 How to create a Facebook fan page with Flash
02/08/2012 Digital Clock
01/18/2012 Recording webcam video & audio in a flv file on local drive

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement