When was actionscript 3 introduced




















Styles, skins and themes. User Interface UI. Working with Data. Loading External Data. Frameworks and Libraries. Create an Application. Aside from making animation, Flash is also well-known for creating interactive applications. Action Script 3. Also, AS3. In this sort lesson, our goal is to provide you with some basic understanding of some crucial concepts and the syntax; so once you can find ready-made AS3.

Unfortunately, if you had previous experience in AS2. The reason is that in AS3. It would be easier for programmer, but it become harder for designer since you do not immediately see you have done with your code. If we want to use AS3. As I mentioned before, in order to access a stage element, we need to give it an instance name; you might find we already give it a name when we convert it to a movie clip.

However, that name cannot be referenced by AS3. So under the properties inspector keep the onstage movie clip selected , you can type in a name. Once you gave a name to a Movie Clip symbol, it become a unique instance; by calling the instance name in AS3.

One thing you need to pay attention to is that do not start any instance name with a capital letter; the main reason is that there are many keywords in AS3. An instance name starting with capital letter would confuse Flash and cost all types of strange errors. However, this book focuses primarily on Flash Professional as an ActionScript editor. Many examples will work seamlessly in any ActionScript editor; other examples will rely on symbols found in the library of a sample Flash file FLA.

What Is ActionScript 3. Every new version of ActionScript introduces new features. ActionScript 3. This intentional branching allows for syntax improvements and significantly improves performance, but also makes it more difficult to use multiple versions of ActionScript at the same time.

The Flash Platform. Although they affect only a small portion of the language, differences in these environments prevent ActionScript 3. The fundamentals, however—indeed, the bulk—of the language, are the same throughout. Procedural Versus Object-Oriented Programming. A lot of attention has been focused on the object-oriented programming OOP capabilities of ActionScript 3. However, embracing ActionScript 3. Using Flash, it is still possible to write scripts in the timeline, using functions to organize more complex code.

This is commonly called procedural programming. This also makes moving between such languages a bit easier. The Document Class. Object-oriented programming is not for everyone, but for those starting on the OOP journey, Flash offers a simple stepping off point in the Document class.

Using this feature, you need only specify an external ActionScript class file as your starting point, and no timeline script is required.

Legacy Code Compatibility. Because ActionScript 3. Hello World. This chapter will conclude with you writing your first ActionScript 3. This exercise is just to get you started and build a little confidence. First, a few things are quite different, such as how events are handled and the way assets are displayed. Second, subtle changes run throughout the language.

These are usually small concerns, such as a slight change in the name of a property, but if you are used to ActionScript 2. Most importantly, ActionScript 3. This optimization provides relatively dramatic performance increases, but it means that ActionScript 3.

Typically, whether you are coming to ActionScript 3. Keeping these benefits in mind may help make it easier to learn a robust language, or accept change—particularly when that change may initially seem tedious or overly complicated. Select new features include:. Chapter 2 discusses data typing in depth, but it boils down to telling the compiler and Flash Player which kind of data you want to work with at different points within your project code.

This allows the compiler to warn you if you use the wrong data type, catching related errors. In ActionScript 3. For now, just take heart knowing that error checking and reporting are more vigilant than in any prior version of ActionScript.

Syntax issues have been unified and cleaned up throughout the language. For instance, some property names have been clarified and made consistent by removing leading underscores.

Also, former multiple and varying ways of approaching the same or similar tasks have been simplified and made consistent. The many previous approaches to displaying assets are now consolidated.

Chapter 4 examines this major change introduced by ActionScript 3. Still another example of improved consistency, all events—such as a mouse click or key press—are handled by event listeners in ActionScript 3.

The new event model is very powerful when combined with the display list, allowing mouse and keyboard events to propagate through multiple display objects. The event model is discussed in Chapter 3. It allows you to reference XML data the same way you reference properties of other objects, such as movie clips or buttons, using a similar syntax.

This is comfortable territory when you remember that a movie clip called mc2 , nested inside a movie clip called mc1 , is referenced as mc1. New text-processing options now allow for much finer control over text manipulation. For example, you can now find the contents of a particular line in a text field, the number of characters in that line, and the character at a specified point such as under the mouse.

This new engine provides a greater degree of text control, including traditional typographic features, automatic text flow, and even support for right-to-left and vertical text layouts and double-byte languages such as Chinese, Japanese, and Korean, among others.

Text is discussed in Chapter On a practical level, they improve programmatic control over both individual sounds and all sounds playing. Sounds are now placed into separate channels, making it easier to work with more than one discrete sound. Sounds are also funneled through a sound mixer for collective control.

You can get the amplitude and frequency spectrum data from sounds during playback, as well as from microphone input. Chapter 11 covers sound in detail. For more advanced needs, you can access raw binary data at runtime. Individual bytes of data can be read during download, during sound playback, or from bitmap data, to name a few examples. These bytes can be stored in a large list and still be accessed quickly and efficiently.

In a programming language, the word scope is sometimes used to define the realm in which an object, such as a movie clip, lives. From a workflow standpoint, no. Their absence in ActionScript 3. Because ActionScript 3. With one small exception discussed in Chapter 4 , event handling is now consolidated across the board into a single, consistent approach: the EventDispatcher. This means that in ActionScript 3.

The basic structure looks like this:. And it gets better. Depth management is now automatic. Notice that the expression new MovieClip does not require a depth parameter. This change is due to a fundamental new approach to the display of visual objects in ActionScript 3.

This concept is embodied in the DisplayObjectContainer class, the base class for all objects that can serve as visual containers, including movie clips, the new Sprite and Loader classes, and more. Thanks to inheritance, DisplayObjectContainer provides new methods to these classes for considerably better control over the management of object z-order. For example, while the MovieClip class in ActionScript 2.

Under the display list system, objects can be re-parented at any time. This ability simplifies cases in which groups of objects need to be manipulated at once. Consider a jigsaw puzzle game, for example. If you want to combine partially solved areas, so that snapped-together pieces move as one unit, you can simply remove the piece from its current parent and add it as a child to the parent that represents the partially solved group.

Flash Player 8 was the first to support 32 simultaneous sound channels, a significant increase from the original eight-sound channel limit. Although present for as long as Flash Player has supported sound, these sound channels, as such, had no clear representation in code before ActionScript 3. In previous versions of the language, the Sound class was self-contained, handling all of its functionality in a relatively simple manner, but at the cost of some clarity of purpose.

For example, in order to control the volume and panning of one sound distinctly from another, you had to associate each sound with its own movie clip. Because target movie clips might or might not contain other content, their ambiguous roles had the potential to confuse.

These new APIs give you more explicit control over imported and embedded sounds. The SoundMixer. The new ByteArray class enables interoperability with existing custom protocols, and lets advanced developers read, write, and manipulate data on the byte level. One of these compilers is built into Flash CS4 itself. This compiler can also compile previous versions of ActionScript.

In addition to ActionScript 3. For want of a library, the second compiler lets metadata embed assets into resultant SWF files. The Flash authoring tool supports only limited metadata, an undocumented feature at the time of writing.

These distinct compilers serve independent workflows. By comparison, Flash offers a modest subset of user controls in its Components panel, including support for the playback and manipulation of Flash video files FLV. The concept of the document class see Chapter 6 , introduced in Flash CS3, means that an entire application, composed of numerous external classes, can be compiled by Flash or the Flex command line compiler including Flex Builder from identical source files.

Flash Player 9 runs on numerous operating systems, including several versions of Windows, Macintosh, Linux, and Solaris. Due to the varied nature of these operating systems and occasional bug fixes required by each, in addition to ongoing new features, Flash Player 9 includes a number of minor point releases, as summarized in Table Time will tell.

To determine what version of Flash Player the user has installed, reference the static version property of the Capabilities class. Support for Windows Vista operating system.

Security enhancements. Affects only Windows and Macintosh platforms. Hardware acceleration, hardware scaling, multi-threaded video decoding, and enhanced image scaling. Flash Player cache enables common components, such as the Flex Framework, to be cached locally and then used by any SWF from any domain. Flash Media Server buffering maintains stream buffer while a stream is paused.

For years, you were making do with a hand-crank drill, but then the Macromedia Hardware Company introduced an electric model called ActionScript 1. Beautiful thing! No reason to ever use anything else. Sure, you could operate the drill only within six feet of an electrical outlet because that was the length of the cord , but the advantages were resoundingly clear.

Plus, you could always carry around an extension cable. A few years later, Macromedia announced a new and improved ActionScript 2. This drill had an optional battery back. For some, the new battery pack was a godsend, because it freed them from the previous six foot limitation. They embraced the new feature and literally found themselves running with it.

Other carpenters found the battery pack a bit too advanced. And honestly, that was fine: the drill still had a cord, of course, so they continued within their previous comfort zone, which was still a considerable improvement over the hand-crank days.

Carpenters were a happy bunch. Eventually, the Macromedia Hardware Company became Adobe. Everyone looked forward to the new drill—ActionScript 3. Suddenly, carpenters who had opted not to use the ActionScript 2. They had no experience with batteries, but if they were going to use an ActionScript 3. It goes without saying that every analogy has its flaws. Certainly, the changes in ActionScript 3. Clearly, the new APIs are more complex than the question of how to recharge a set of batteries.

In any case, ActionScript does a lot more than drill holes! Still, it can be useful to think of ActionScript 2.



0コメント

  • 1000 / 1000