The document compares ActionScript 2 (AS2) and ActionScript 3 (AS3). It discusses the top misperceptions about AS3, including that it is difficult to learn, only for object-oriented programming, and reduces the targetable Flash Player base. It also outlines the top benefits of AS3, such as improved performance, ability to leverage new Flash Player APIs, easier debugging, and future-proof development. The document provides examples of migrating common tasks like variables, functions, and event handling from AS2 to AS3.
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
As2 vs as3
1. AS2 vs AS3
Yash Mody
CTO | Tekno Point
yash@teknopoint.us
®
1
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
2. Overview
ActionScript 3.0 Overview
Top Misperceptions
Top Bene ts
Migration Examples
®
2
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
3. Top 5 Misperceptions
about ActionScript 3.0
®
3
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
4. Misperception #1
ActionScript 3.0 is difficult to learn
®
4
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
5. Misperception #2
ActionScript 3.0 is only for Class based
object-oriented programming
®
5
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
6. Misperception #3
Using ActionScript 3.0 reduces the
Flash Player base that you can target
®
6
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
7. Misperception #4
You can’t write code on the timeline
with ActionScript 3.0
®
7
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
8. Misperception #5
ActionScript 2.0 development is faster
that ActionScript 3.0 development
®
8
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
9. Top 5 Benefits of
ActionScript 3.0
®
9
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
10. Benefit #1
Performance
®
10
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
11. Benefit #2
Ability to leverage new Flash Player
APIs and technologies
®
11
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
12. Benefit #3
Leverage Community Libraries and APIs
®
12
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
13. Benefit #4
Easier and faster to debug code
®
13
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
14. Benefit #5
Future proofed, multi-platform
development
®
14
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
15. ActionScript 3.0
Gotchas
• Use of underscore
• Void / void
• Alpha value range
• Event Model
• Code and events on Symbols
®
15
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
16. underscores
ActionScript 2.0 ActionScript 3.0
®
16
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
17. void
ActionScript 2.0 ActionScript 3.0
®
17
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
18. alpha
0-100 0.0-1.0
ActionScript 2.0 ActionScript 3.0
®
18
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
19. Events
®
19
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
20. no code on symbols
®
20
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
21. Migration Examples
®
21
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
22. Create a Variable
Create a Function
Create an if statement
®
22
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
24. Loop Through an
Array
®
24
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
25. _root
®
25
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
26. Handling Button Clicks
®
26
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
27. Opening a URL
®
27
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
28. Dynamically Attach a
MovieClip
®
28
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
29. Load an Image
®
29
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
30. Play a Sound
®
30
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
31. Load and Parse XML…
the E4X way
®
31
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.
32. Some more stuff
Runtime Exceptions - increase in conditions
Sealed Classes - xed set of values - better
maintainability
Method closures - The
mx.utils.Delegate not required
Regular expressions - native
support for better string manipulation
32
33. Get onto AS3 today
®
33
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe Con dential.