Prototype-based programming is a style of object oriented programming. Prototype based porgramming encourages the programmer to focus on the behavior of some set of examples and only later worry about classifying these objects that are later used in a fashipn similar to classes. Prototype based programming is also known as class-less, prototype-oriented or instance-based programming. Classless programming style is supported by the following programming languages. JavaScript, ActionScript , Lua Open Laszlo In prototype based programming behaviour resues ( known as inheritance in class-based languages) is performed via a process of cloning existing objects that serve as prototypes. Cloning refers to a process whereby a new object is constucted by copyin the behavior of an existing object (its prototype). The new object then carries all the qualities of the original. From this point on, the new object can be modified. The resulting child object maintains an explicit link...
import flash.filesystem.*; public class MyFile { private var stream: FileStream; private function saveFile(): void { var file:File = File.desktopDirectory.resolvePath("file.txt"); var stream:FileStream = new FileStrem(); stream.open(fiel, FileMode.WRITE); var str:String = "file content"; stream.writeUTFBytes(str); stream.close(); } }
Image by Dekuwa via Flickr The Flash Player APIs in ActionScript 3.0 contain many classes to control objects at a low level. Adobe® AIR™ applications can also use the Flash Player APIs. DOM3 event model - Document Object Model Level 3 event model (DOM3) provides a standard way of generating and handling event messages so that ActionScript objects can interact and communicate, maintaining their state and responding to change. ActionScript 3.0 event model is based on World Wide Web Consortium DOM Level 3 Events Specification and provides a clearer and efficient mechanism. Events and error events are located in the flash.events package. The Flex application framework uses the same event model as the Flash Player API , so the event system is unified across the Flash platform. Display list API - The API for accessing the Flash Player and Adobe AIR display list (the tree that contains any visual elements in the application) consists of classes for working with visual primitives. Dept...
Comments
Post a Comment