These includeĬlasses like Object, Array, Bitmap, and Event, etc. Internally and always available for use to the Flash developer. The Flash player has many native ActionScript classes that are defined You create new objects in ActionScript, you are creating instances of a class. Object contains and what methods are used when working with that object.
Would be a good idea to be familiar with Object Oriented Programming (OOP) orĪt least how to effectively create and use custom classes.Ĭlasses are templates for object instances. A clear understanding and ability to use OOP in ActionScript To be able to use ActionScript 3 to its fullest potential, it OOP in ActionScriptĪctionScript 3 relies heavily on OOP, more so than ActionScript 1 orĪctionScript 2. In programming, you have one object able to be used in different places with different types as long as that object represents that type, either through its own class definition, an inherited definition or an interface definition. It is an apple, a fruit, and food - three different contexts which it satisfies. This relates to polymorphism but instead of having one context for many different objects, you have one object fitting into many other contexts. Unlike with inheritance, typing through composition can only be made through interfaces since the composited object's type is not inherited by the object controlling it.Ībstraction relates to how a single object can be represented as different types based on context. This is an alternative to inheritance that, though requires a little more effort, is often more flexible and does a better job enforcing encapsulation. Interfaces (types) and non-private properties and methods are inherited by subclasses.Ĭomposition is the means by which one object acquires another object's functionality by controlling an instance of that object. Subclasses inherit or extend their superclasses. The definition based off that class is known as the subclass. The original class definition is known as the superclass. Inheritance describes the process by which one object is based on the definition of another. Types are defined by class definitions and interface definitions and indicate the kind of object based on its available interface. Interface definitions - class like definitions that outline what properties and methods exist for a certain type of interface - can be implemented by classes to associate them with a type. Objects capable of being interchanged in this manner have the same interface, or the same collection of properties or methods required to satisfy the context in which they are to be used. Polymorphism is being able to use more than one object in the same context.
This idea facilitates robust, reusable and modular code. That implementation is buried away and cannot (normally) be changed. This basically means, given an object, a user should be able to know how to use that object (using its interface) but not know how the object does what it does. OOP focuses on some of the following concepts:Įncapsulation is the idea that object implementation as defined by its class is hidden from and inaccessible to the user of that class. Templates known as classes are used to define the properties and methods that make up objects in code. Post in the comments if you find any errors.Object Oriented Programming (OOP) is an object-based style of programming that uses objects to store and work with data. I had to create the list for a reference guide I am working on, so I figured I would post it here in case anyone found it useful. Below is a list of all ActionScript 3 classes in the Flash Player, Flex 3, and Adobe AIR 1.0 APIs that implement interfaces, as well a list of the interfaces that they implement.