getting started with action script 3.0

12

Upload: daryl-ivan-hisola

Post on 09-Apr-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 1/12

Page 2: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 2/12

Topicy What Is ActionScript?

y Whats New in ActionScript 3.0?

y Summary 

Page 3: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 3/12

What Is ActionScript?y ActionScript is a programming language that is used to

create content for Flash Player.

y You can use tools such as Flash CS3 Professional or FlexBuilder to create content using other tools andtechnologies such as drawing tools, library symbols,timelines, and MXML.

y However, ActionScript can be used either as a complementto these things or in place of these things in order to createFlash content.

y ActionScript is often necessary when you want to createFlash applications that are highly dynamic, responsive,reusable, and/or customizable.

Page 4: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 4/12

What Is ActionScript?y Heres just a short list of the many things you can

accomplish using ActionScript:

y

Loading imagesy Playing audio and video

y Drawing programmatically 

y Loading data such as XML files

y Responding to user events such as mouse clicks

Page 5: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 5/12

Whats New in ActionScript 3.0?y ActionScript 3.0 has a whole lot of new features, here

is an overview of the key new features.

yDisplay List

y Runtime Errors

y Method Closures

y Intrinsic Event Model

y Regular Expressionsy E4X 

Page 6: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 6/12

Whats New in ActionScript 3.0?y Display List

y In ActionScript 2.0, there were three basic types of objects that could be displayed: movie clips, buttons,and text fields. These types didnt inherit from acommon source, meaning polymorphism didnt work forthese display types. Furthermore, instances of thesedisplay types always had a fixed, parent-childrelationship with other instances.

y For example, to create a movie clip you had to createthat movie clip as a child of an existing movie clip. It wasnot possible to move a movie clip from one parent toanother.

Page 7: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 7/12

y Runtime Errorsy ActionScript 3.0 provides many new runtime errors. This

is an important new feature because it allows you todiagnose problems much more quickly.

y In ActionScript 2.0, when an error occurred at runtime itwould frequently occur silently, and it would be difficultfor you as the developer to determine what the problemwas.

y With improved runtime errors and error reporting inthe debug player it is now much easier to debugActionScript 3.0 applications than it was withActionScript 2.0.

Page 8: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 8/12

Whats New in ActionScript 3.0?y Method Closures

y In ActionScript 3.0 all methods have proper method closures,which means that a reference to a method always includes theobject from which the method was originally referenced.

y This is important for event handling, and it stands in starkcontrast to method closures in ActionScript 2.0.

y In ActionScript 2.0, when you reference a method, the object

from which the method is referenced does not persist. Thiscauses problems most notably when adding event listeners.

y In ActionScript 2.0, a delegate is often used as a solution.However, in ActionScript 3.0 delegates are not necessary.

Page 9: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 9/12

Whats New in ActionScript 3.0?y Intrinsic Event Model

y In ActionScript 3.0, the event model is built right in to

the core language.y The flash.events.EventDispatcher class is the base class

for many native ActionScript classes, including all thedisplay object types. This means that there is onestandard way to dispatch and handle events inActionScript 3.0.

Page 10: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 10/12

Whats New in ActionScript 3.0?y Regular Expressions

y Regular expressions are a powerful way to find

substrings that match patterns.y Although regular expressions have long been built into

sister languages such as JavaScript, regular expressionswere never a part of ActionScript until now.

y ActionScript 3.0 includes an intrinsic RegExp class,which allows you to run regular expressions natively inFlash Player.

Page 11: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 11/12

Whats New in ActionScript 3.0?y E4X 

y E4X is short for ECMAScript for XML, and it is a new

way to work with XML data in ActionScript.y Although you can still work with XML as you did in

ActionScript 2.0 by traversing the DOM, E4X allows youto work with XML in a much more natural and intuitivemanner.

Page 12: Getting Started With Action Script 3.0

8/8/2019 Getting Started With Action Script 3.0

http://slidepdf.com/reader/full/getting-started-with-action-script-30 12/12

Summaryy ActionScript 3.0 is a new language with enough similarities

to ActionScript 2.0 to make the learning curve low.

y

You can use ActionScript 3.0 just as you used ActionScript2.0 (in classes or on the timeline), though the preferredusage of ActionScript 3.0 is in classes using object-orientedprinciples.

y ActionScript 3.0 introduces a lot of new features, including

a new way to manage display types, runtime error handling,runtime data types, method closures, an intrinsic eventmodel, regular expressions, and a new way of working withXML.