as2 vs as3
DESCRIPTION
My presentation from the Flash CS4 launch in India.TRANSCRIPT
1
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
AS2 vs AS3
Yash ModyCTO | Tekno [email protected]
2
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Overview
ActionScript 3.0 Overview
Top Misperceptions
Top Bene!ts
Migration Examples
3
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Top 5 Misperceptionsabout ActionScript 3.0
4
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Misperception #1
ActionScript 3.0 is difficult to learn
5
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Misperception #2ActionScript 3.0 is only for Class based
object-oriented programming
6
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Misperception #3Using ActionScript 3.0 reduces the
Flash Player base that you can target
7
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Misperception #4You can’t write code on the timeline
with ActionScript 3.0
8
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Misperception #5ActionScript 2.0 development is faster
that ActionScript 3.0 development
9
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Top 5 Benefits ofActionScript 3.0
10
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Benefit #1
Performance
11
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Benefit #2Ability to leverage new Flash Player
APIs and technologies
12
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Benefit #3
Leverage Community Libraries and APIs
13
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Benefit #4
Easier and faster to debug code
14
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Benefit #5Future proofed, multi-platform
development
15
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
•Use of underscore•Void / void•Alpha value range• Event Model•Code and events on Symbols
ActionScript 3.0Gotchas
16
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
underscores
ActionScript 2.0 ActionScript 3.0
17
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
void
ActionScript 2.0 ActionScript 3.0
18
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
alpha
ActionScript 2.0 ActionScript 3.0
0-100 0.0-1.0
19
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Events
20
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
no code on symbols
21
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Migration Examples
22
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Create a VariableCreate a FunctionCreate an if statement
23
24
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Loop Through anArray
25
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
_root
26
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Handling Button Clicks
27
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Opening a URL
28
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Dynamically Attach aMovieClip
29
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Load an Image
30
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Play a Sound
31
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Load and Parse XML…the E4X way
32
Some more stuff Runtime Exceptions - increase in conditions Sealed Classes - !xed set of values - better
maintainability
Method closures - Themx.utils.Delegate not required
Regular expressions - nativesupport for better string manipulation
33
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con!dential.
Get onto AS3 today