Book description
Given its ability to deliver high-impact experiences even over low-bandwidth connections, Flash has become the de facto standard for hundreds of thousands of multimedia web developers worldwide. Flash 5 now includes a new full-fledged programming language called "ActionScript" for controlling animation and multimedia. It's a quantum leap from the bare-bones "Actions" supported in Flash 4, and ActionScript: The Definitive Guide is the first book dedicated entirely to documenting and demonstrating this new language. ActionScript includes all fundamental programming constructs (variables, loops, conditionals, functions, etc.), and is inextricably fused with Flash's authoring behaviors and animation timelines. Because ActionScript is based heavily on the ECMAScript Language Specification (ECMA-262) and is syntactically nearly identical to JavaScript, Macromedia expects thousands of existing JavaScript programmers to migrate to ActionScript. This book is divided into three sections.
"ActionScript Fundamentals" introduces both programmers and non-programmers to the new language by first describing fundamental programming concepts and then delineating in detail the components, syntax, and usage of ActionScript.
"Applied ActionScript Code Depot" shows you how to use common applications, such as processing online forms.
"Language Reference" is a concise and detailed reference that makes all ActionScript globals, properties, and objects, including extensive implementation samples, easy to find quickly.
Step-by-step tutorials of the most common ActionScript behaviors
Object-oriented programming in Flash
Intelligent interface development
Server communication
Dynamic content generation
Password protection
String handling
Message boards
Basic physics
Games
Code samples are also available from the "Code Depot" on the author's web site devoted to Flash developers. Topics covered in this book include:
ActionScript: The Definitive Guide is structured so both programmers and non-programmers can learn how to use ActionScript. This book will take you well beyond simple Flash animations so you can create your own enhanced Flash-driven sites.
Table of contents
-
ActionScript: The Definitive Guide
- Foreword
- Preface
-
I. ActionScript Fundamentals
- 1. A Gentle Introduction for Non-Programmers
-
2. Variables
- Creating Variables (Declaration)
- Assigning Variables
- Changing and Retrieving Variable Values
- Types of Values
- Variable Scope
- Some Applied Examples
- Onward!
-
3. Data and Datatypes
- Data Versus Information
- Retaining Meaning with Datatypes
- Creating and Categorizing Data
-
Datatype Conversion
- Automatic Type Conversion
-
Explicit Type Conversion
- Converting to a string with the toString( ) method
- Converting to a string with the String( ) function
- Converting to a string with empty string concatenation
- Converting to a number with the Number( ) function
- Converting to a number by subtracting zero
- Converting to a number using the parseInt( ) and parseFloat( ) functions
- Converting to a Boolean
- Conversion Duration
- Flash 4-to-Flash 5 Datatype Conversion
- Determining the Type of an Existing Datum
- Primitive Data Versus Composite Data
- Onward!
-
4. Primitive Datatypes
- The Number Type
- Integers and Floating-Point Numbers
- Numeric Literals
- Working with Numbers
- The String Type
-
Working with Strings
- Joining Strings Together
- Comparing Strings
- Using Built-in String Functions
- Character Indexing
- Examining Strings
- Retrieving Portions of Strings
- Combining String Examination with Substring Extraction
- Character Case Conversion
- Character Code Functions
- Executing Code in a String with eval
- Flash 4 Versus Flash 5 String Operators and Functions
- The Boolean Type
- Undefined
- Null
- Onward!
- 5. Operators
- 6. Statements
- 7. Conditionals
- 8. Loop Statements
-
9. Functions
- Creating Functions
- Running Functions
- Passing Information to Functions
- Exiting and Returning Valuesfrom Functions
- Function Literals
- Function Availability and Life Span
- Function Scope
- Function Parameters Revisited
- Recursive Functions
- Internal Functions
- Functions as Objects
- Centralizing Code
- The Multiple-Choice Quiz Revisited
- Onward!
-
10. Events and Event Handlers
- Synchronous Code Execution
- Event-Based AsynchronousCode Execution
- Types of Events
- Event Handlers
- Event Handler Syntax
- Creating Event Handlers
- Event Handler Scope
- Button Events
- Movie Clip Events Overview
- Movie-Playback Movie Clip Events
- The User-Input Movie Clip Events
- Order of Execution
- Copying Clip Event Handlers
- Refreshing the Screen with updateAfterEvent
- Code Reusability
- Dynamic Movie Clip Event Handlers
- Event Handlers Applied
- Onward!
- 11. Arrays
- 12. Objects and Classes
-
13. Movie Clips
- The “Objectness” of Movie Clips
- Types of Movie Clips
- Creating Movie Clips
- Movie and Instance Stacking Order
- Referring to Instances and Main Movies
- Removing Clip Instances and Main Movies
- Built-in Movie Clip Properties
- Movie Clip Methods
- Applied Movie Clip Examples
- The Last Quiz
- Onward!
- 14. Lexical Structure
- 15. Advanced Topics
-
II. Applied ActionScript
-
16. ActionScript Authoring Environment
- The Actions Panel
- Adding Scripts to Frames
- Adding Scripts to Buttons
- Adding Scripts to Movie Clips
- Where’s All the Code?
- Productivity
- Externalizing ActionScript Code
- Packaging Components as Smart Clips
- Onward!
- 17. Flash Forms
-
18. On-Screen Text Fields
- Dynamic Text Fields
- User-Input Text Fields
- Text Field Options
- Text Field Properties
-
HTML Support
- <B> (Bold)
- <I> (Italics)
- <U> (Underline)
- <FONT> (Font Control)
- <P> (Paragraph Break)
- <BR> (Line Break)
- < A> (Anchor or Hypertext Link)
- Anchor Tag Tab Order
- Quoting Attribute Values
- Unrecognized Tags and Attributes
- Using HTML as Output
- Using HTML as Input
- Executing JavaScript from HTML Links
- Calling ActionScript Functions from HTML Links
- Working with Text Field Selections
- Empty Text Fields and the for-in Statement
- Onward!
- 19. Debugging
-
16. ActionScript Authoring Environment
-
III. Language Reference
-
20. ActionScript Language Reference
- Global Functions
- Global Properties
- Built-in Classes and Objects
- Entry Headings
-
Alphabetical Language Reference
- Arguments Object
- arguments.callee Property
- arguments.length Property
- Array Class
- Array.concat( ) Method
- Array.join( ) Method
- Array.length Property
- Array.pop( ) Method
- Array.push( ) Method
- Array.reverse( ) Method
- Array.shift( ) Method
- Array.slice( ) Method
- Array.sort( ) Method
- Array.splice( ) Method
- Array.toString( ) Method
- Array.unshift( ) Method
- Boolean( ) Global Function
- Boolean Class
- Boolean.toString( ) Method
- Boolean.valueOf( ) Method
- Call( ) Global Function
- Color Class
- Color.getRGB( ) Method
- Color.getTransform( ) Method
- Color.setRGB( ) Method
- Color.setTransform( ) Method
- Date( ) Global Function
- Date Class
- Date.getDate( ) Method
- Date.getDay( ) Method
- Date.getFullYear( ) Method
- Date.getHours( ) Method
- Date.getMilliseconds( ) Method
- Date.getMinutes( ) Method
- Date.getMonth( ) Method
- Date.getSeconds( ) Method
- Date.getTime( ) Method
- Date.getTimezoneOffset( ) Method
- Date.getUTCDate( ) Method
- Date.getUTCDay( ) Method
- Date.getUTCFullYear( ) Method
- Date.getUTCHours( ) Method
- Date.getUTCMilliseconds( ) Method
- Date.getUTCMinutes( ) Method
- Date.getUTCMonth( ) Method
- Date.getUTCSeconds( ) Method
- Date.getYear( ) Method
- Date.setDate( ) Method
- Date.setFullYear( ) Method
- Date.setHours( ) Method
- Date.setMilliseconds( ) Method
- Date.setMinutes( ) Method
- Date.setMonth( ) Method
- Date.setSeconds( ) Method
- Date.setTime( ) Method
- Date.setUTCDate( ) Method
- Date.setUTCFullYear( ) Method
- Date.setUTCHours( ) Method
- Date.setUTCMilliseconds( ) Method
- Date.setUTCMinutes( ) Method
- Date.setUTCMonth( ) Method
- Date.setUTCSeconds( ) Method
- Date.setYear( ) Method
- Date.toString( ) Method
- Date.UTC( ) Class Method
- Date.valueOf( ) Method
- duplicateMovieClip( ) Global Function
- escape( ) Global Function
- eval( ) Global Function
- _focusrect Global Property
- fscommand( ) Global Function
- getProperty( ) Global Function
- getTimer( ) Global Function
- getURL( ) Global Function
- getVersion( ) Global Function
- gotoAndPlay( ) Global Function
- gotoAndStop( ) Global Function
- _highquality Global Property
- #include Directive
- Infinity Global Property
- -Infinity Global Property
- int( ) Global Function
- isFinite( ) Global Function
- isNaN( ) Global Function
- Key Object
- Key.getAscii( ) Method
- Key.getCode( ) Method
- Key.isDown( ) Method
- Key.isToggled( ) Method
- _leveln Global Property
- loadMovie( ) Global Function
- loadMovieNum( ) Global Function
- loadVariables( ) Global Function
- loadVariablesNum( ) Global Function
- Math Object
- Math.abs( ) Method
- Math.acos( ) Method
- Math.asin( ) Method
- Math.atan( ) Method
- Math.atan2( ) Method
- Math.ceil( ) Method
- Math.cos( ) Method
- Math.E Property
- Math.exp( ) Method
- Math.floor( ) Method
- Math.LN10 Property
- Math.LN2 Property
- Math.log( ) Method
- Math.LOG10E Property
- Math.LOG2E Property
- Math.max( ) Method
- Math.min( ) Method
- Math.PI Property
- Math.pow( ) Method
- Math.random( ) Method
- Math.round( ) Method
- Math.sin( ) Method
- Math.sqrt( ) Method
- Math.SQRT1_2 Property
- Math.SQRT2 Property
- Math.tan( ) Method
- maxscroll Property
- Mouse Object
- Mouse.hide( ) Method
- Mouse.show( ) Method
- MovieClip “Class”
- MovieClip._alpha Property
- MovieClip.attachMovie( ) Method
- MovieClip._currentframe Property
- MovieClip._droptarget Property
- MovieClip.duplicateMovieClip( ) Method
- MovieClip._framesloaded Property
- MovieClip.getBounds( ) Method
- MovieClip.getBytesLoaded( ) Method
- MovieClip.getBytesTotal( ) Method
- MovieClip.getURL( ) Method
- MovieClip.globalToLocal( ) Method
- MovieClip.gotoAndPlay( ) Method
- MovieClip.gotoAndStop( ) Method
- MovieClip._height Property
- MovieClip.hitTest( ) Method
- MovieClip.loadMovie( ) Method
- MovieClip.loadVariables( ) Method
- MovieClip.localToGlobal( ) Method
- MovieClip._name Property
- MovieClip.nextFrame( ) Method
- MovieClip._parent Property
- MovieClip.play( ) Method
- MovieClip.prevFrame( ) Method
- MovieClip.removeMovieClip( ) Method
- MovieClip._rotation Property
- MovieClip.startDrag( ) Method
- MovieClip.stop( ) Method
- MovieClip.stopDrag( ) Method
- MovieClip.swapDepths( ) Method
- MovieClip._target Property
- MovieClip._totalframes Property
- MovieClip.unloadMovie( ) Method
- MovieClip._url Property
- MovieClip.valueOf( ) Method
- MovieClip._visible Property
- MovieClip._width Property
- MovieClip._x Property
- MovieClip._xmouse Property
- MovieClip._xscale Property
- MovieClip._y Property
- MovieClip._ymouse Property
- MovieClip._yscale Property
- NaN Global Property
- newline Constant
- nextFrame( ) Global Function
- nextScene( ) Global Function
- Number( ) Global Function
- Number Class
- Number.MAX_VALUE Property
- Number.MIN_VALUE Property
- Number.NaN Property
- Number.NEGATIVE_INFINITY Property
- Number.POSITIVE_INFINITY Property
- Number.toString( ) Method
- Object Class
- Object.constructor Property
- Object.__proto__ Property
- Object.toString( ) Method
- Object.valueOf( ) Method
- parseFloat( ) Global Function
- parseInt( ) Global Function
- play( ) Global Function
- prevFrame( ) Global Function
- prevScene( ) Global Function
- print( ) Global Function
- printAsBitmap( ) Global Function
- printAsBitmapNum( ) Global Function
- printNum( ) Global Function
- _quality Global Property
- random( ) Global Function
- removeMovieClip( ) Global Function
- _root Global Property
- scroll Property
- Selection Object
- Selection.getBeginIndex( ) Method
- Selection.getCaretIndex( ) Method
- Selection.getEndIndex( ) Method
- Selection.getFocus( ) Method
- Selection.setFocus( ) Method
- Selection.setSelection( ) Method
- setProperty( ) Global Function
- Sound Class
- Sound.attachSound( ) Method
- Sound.getPan( ) Method
- Sound.getTransform( ) Method
- Sound.getVolume( ) Method
- Sound.setPan( ) Method
- Sound.setTransform( ) Method
- Sound.setVolume( ) Method
- Sound.start( ) Method
- Sound.stop( ) Method
- _soundbuftime Global Property
- startDrag( ) Global Function
- stop( ) Global Function
- stopAllSounds( ) Global Function
- stopDrag( ) Global Function
- String( ) Global Function
- String Class
- String.charAt( ) Method
- String.charCodeAt( ) Method
- String.concat( ) Method
- String.fromCharCode( ) Class Method
- String.indexOf( ) Method
- String.lastIndexOf( ) Method
- String.length Property
- String.slice( ) Method
- String.split( ) Method
- String.substr( ) Method
- String.substring( ) Method
- String.toLowerCase( ) Method
- String.toUpperCase( ) Method
- targetPath( ) Global Function
- tellTarget( ) Global Function
- toggleHighQuality( ) Global Function
- trace( ) Global Function
- unescape( ) Global Function
- unloadMovie( ) Global Function
- unloadMovieNum( ) Global Function
- updateAfterEvent( ) Global Function
- $version “Global” Property
- XML Class
- XML.appendChild( ) Method
- XML.attributes Property
- XML.childNodes Property
- XML.cloneNode( ) Method
- XML.contentType Property
- XML.createElement( ) Method
- XML.createTextNode( ) Method
- XML.docTypeDecl Property
- XML.firstChild Property
- XML.hasChildNodes( ) Method
- XML.ignoreWhite Property
- XML.insertBefore( ) Method
- XML.lastChild Property
- XML.load( ) Method
- XML.loaded Property
- XML.nextSibling Property
- XML.nodeName Property
- XML.nodeType Property
- XML.nodeValue Property
- XML.onData( ) Event Handler
- XML.onLoad( ) Event Handler
- XML.parentNode Property
- XML.parseXML( ) Method
- XML.previousSibling Property
- XML.removeNode( ) Method
- XML.send( ) Method
- XML.sendAndLoad( ) Method
- XML.status Property
- XML.toString( ) Method
- XML.xmlDecl Property
- XMLnode Class
- XMLSocket Class
- XMLSocket.close( ) Method
- XMLSocket.connect( ) Method
- XMLSocket.onClose( ) Event Handler
- XMLSocket.onConnect( ) Event Handler
- XMLSocket.onData( ) Event Handler
- XMLSocket.onXML( ) Event Handler
- XMLSocket.send( ) Method
-
20. ActionScript Language Reference
- IV. Appendixes
- Index
- Colophon
Product information
- Title: ActionScript: The Definitive Guide
- Author(s):
- Release date: May 2001
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781565928527
You might also like
book
Actionscript Cookbook
When you need to get the job done fast, you'll reach for this practical, nuts-n-bolts toolkit. …
book
Essential ActionScript 2.0
In September 2003, Macromedia released Flash MX 2004, and with it, ActionScript 2.0, a dramatically improved …
book
ActionScript 3.0 Design Patterns
Now that ActionScript is reengineered from top to bottom as a true object-oriented programming (OOP) language, …
book
Learning ActionScript 3.0, 2nd Edition
If you're new to ActionScript 3.0, or want to enhance your skill set, this bestselling book …