Book description
Updated to cover Flash MX, the newest version of Macromedia Flash, ActionScript for Flash MX: The Definitive Guide, Second Edition is the one book no serious Flash developer should be without. ActionScript is Macromedia's programming language for Flash MX, the popular authoring tool for creating rich internet applications and animations for the Web. With Macromedia's new focus on application development, ActionScript now includes a direct drawing API, loading of external MP3 and JPG files, improved sound control, an extensive set of text formatting tools, complete support for component development using movie clip subclasses, local data storage, accessibility features, and much more. And ActionScript for Flash MX: The Definitive Guide is the most complete, up-to-date reference available for the latest version of this language. Author Colin Moock, one of the most universally respected developers in the Flash community, has added hundreds of new code examples to show new Flash MX techniques in the real world: how to draw circles, save data to disk, convert arrays to onscreen tables, create reusable components, and preload variables, XML, and sounds. The book's language reference alone has nearly doubled from the first edition, with more than 250 new classes, objects, methods, and properties. You'll find exhaustive coverage of dozens of undocumented, under-documented, and mis-documented features. Along with the new material, Colin Moock has meticulously revised the entire text to conform to Flash MX best-coding practices. In particular, objected-oriented programming and the new event model get special attention in light of changes to Flash MX ActionScript. From sending data between two movies to creating getter/setter properties, the new edition of this book demystifies the often-confusing new features of Flash MX, giving developers easy access to its powerful new capabilities. ActionScript for Flash MX: The Definitive Guide is structured so non-programmers can learn how to use ActionScript and programmers can take their skills to new heights. If you are in the market to really learn about the hows and whys of ActionScript, then this is the book for you.
Table of contents
- Table of Contents (1/2)
- Table of Contents (2/2)
- Foreword
- Preface
- Part I
- A Gentle Introduction for Nonprogrammers
-
Variables
- Creating Variables (Declaration)
- Assigning Values to Variables
- Changing and Retrieving Variable Values
- Types of Values
- Variable Scope
- Loading External Variables
- Some Applied Examples
- Onward!
-
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
- Determining the Type of an Existing Datum
- Primitive Data Versus Composite Data
- Copying, Comparing, and Passing Data
- Onward!
-
Primitive Datatypes
- The Number Type
- Integers and Floating-Point Numbers
- Numeric Literals
- Working with Numbers
- The String Type
- Working with Strings
- The Boolean Type
- Undefined
- Null
- Onward!
-
Operators
- General Features of Operators
- The Assignment Operator
- Arithmetic Operators
- The Equality and Inequality Operators
- The Strict Equality and Inequality Operators
- The Comparison Operators
- The Flash 4 String Operators
- The Logical Operators
- The Grouping Operator
- The Comma Operator
- The void Operator
- Other Operators
- Onward!
- Statements
- Conditionals
- Loop Statements
-
Functions
- Creating Functions
- Running Functions
- Passing Information to Functions
- Exiting and Returning Values from Functions
- Function Literals
- Function Availability and Life Span
- Function Scope
- Function Parameters Revisited
- Recursive Functions
- Nested Functions
- Built-in Functions
- Functions as Objects
- Centralizing Code
- The Multiple-Choice Quiz Revisited
- Onward!
-
Events and Event Handling
- Synchronous Code Execution
- Event-Based Asynchronous Code Execution
- Types of Events
- Event Handling
- Event Handler Properties
- Listener Events
- Flash 5’s on() and onClipEvent() Handlers
- Event Handler Lifespan
- Event Handler Scope
- Values of the this Keyword
- Flash 5–style onClipEvent() Order of Execution
- Copying Movie Clip Event Handlers
- Refreshing the Screen with updateAfterEvent()
- Code Reusability
- Dynamic Movie Clip Event Handlers
- Event Handlers Applied
- Onward!
-
Arrays
- What Is an Array?
- The Anatomy of an Array
- Creating Arrays
- Referencing Array Elements
- Determining the Size of an Array
- Named Array Elements
- Adding Elements to an Array
- Removing Elements from an Array
- General Array-Manipulation Tools
- Arrays as Objects
- Multidimensional Arrays
- The Multiple-Choice Quiz, Take 3
- Onward!
-
Objects and Classes
- The Anatomy of an Object
- Instantiating Objects
- Object Properties
- Object Methods
- Classes and Object-Oriented Programming
- Using Standalone Object Instances asAssociativeArrays
- The Almighty Prototype Chain
- Built-in ActionScript Classes and Objects
- OOP Quick Reference
- Further Topics
- Simulating Namespaces
- The Multiple-Choice Quiz, OOP Style
- Onward!
-
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
- Method Versus Global Function Overlap Issues
- Drawing in a Movie Clip at Runtime
- Using Movie Clips as Buttons
- Input Focus and Movie Clips
- Building a Clock with Clips
- Onward!
- Movie Clip Subclasses andComponents
- Lexical Structure
-
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
- Defining Components
- Onward!
- Building a Flash Form
- Part II
-
ActionScript Language Reference
- Global Functions
- Global Properties
- Built-in Classes and Objects
- Entry Headings
-
Alphabetical Language Reference
- Accessibility Object
- Accessibility.isActive() Method
- Accessibility.sendEvent() Method
- Arguments Object
- arguments.callee Property
- arguments.caller 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.sortOn() Method
- Array.splice() Method
- Array.toString() Method
- Array.unshift() Method
- Boolean() Global Function
- Boolean Class
- Boolean.toString() Method
- Boolean.valueOf() Method
- Button Class
- Button._alpha Property
- Button.enabled Property
- Button._focusrect Property
- Button.getDepth() Method
- Button._height Property
- Button keyPress Event Handler
- Button._name Property
- Button.onDragOut() Event Handler
- Button.onDragOver() Event Handler
- Button.onKillFocus() Event Handler
- Button.onPress() Event Handler
- Button.onRelease() Event Handler
- Button.onReleaseOutside() Event Handler
- Button.onRollOut() Event Handler
- Button.onRollOver() Event Handler
- Button.onSetFocus() Event Handler
- Button._parent Property
- Button._rotation Property
- Button.tabEnabled Property
- Button.tabIndex Property
- Button._target Property
- Button.trackAsMenu Property
- Button._url Property
- Button.useHandCursor Property
- Button._visible Property
- Button._width Property
- Button._x Property
- Button._xmouse Property
- Button._xscale Property
- Button._y Property
- Button._ymouse Property
- Button._yscale Property
- call() Global Function
- Capabilities Object
- capabilities.hasAccessibility Property
- capabilities.hasAudio Property
- capabilities.hasAudioEncoder Property
- capabilities.hasMP3 Property
- capabilities.hasVideoEncoder Property
- capabilities.input Property
- capabilities.isDebugger Property
- capabilities.language Property
- capabilities.manufacturer Property
- capabilities.os Property
- capabilities.pixelAspectRatio Property
- capabilities.screenColor Property
- capabilities.screenDPI Property
- capabilities.screenResolutionX Property
- capabilities.screenResolutionY Property
- capabilities.serverString Property
- capabilities.version Property
- clearInterval() 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
- delete Operator
- duplicateMovieClip() Global Function
- #endinitclip Pragma
- escape() Global Function
- eval() Global Function
- _focusrect Global Property
- fscommand() Global Function
- Function Class
- Function.apply() Method
- Function.call() Method
- Function.prototype Property
- Function.toString() Method
- getProperty() Global Function
- getTimer() Global Function
- getURL() Global Function
- getVersion() Global Function
- _global Object
- gotoAndPlay() Global Function
- gotoAndStop() Global Function
- _highquality Global Property
- #include Directive
- Infinity Global Property
- -Infinity Global Property
- #initclip Pragma
- instanceof Operator
- int() Global Function
- isFinite() Global Function
- isNaN() Global Function
- Key Object
- Key.addListener() Method
- Key.getAscii() Method
- Key.getCode() Method
- Key.isDown() Method
- Key.isToggled() Method
- Key.onKeyDown() Listener Event
- Key.onKeyUp() Listener Event
- Key.removeListener() Method
- _leveln Global Property
- loadMovie() Global Function
- loadMovieNum() Global Function
- loadVariables() Global Function
- loadVariablesNum() Global Function
- LoadVars Class
- LoadVars.contentType Property
- LoadVars.decode() Method
- LoadVars.getBytesLoaded() Method
- LoadVars.getBytesTotal() Method
- LoadVars.load() Method
- LoadVars.loaded Property
- LoadVars.onData() Event Handler
- LoadVars.onLoad() Event Handler
- LoadVars.send() Method
- LoadVars.sendAndLoad() Method
- LoadVars.toString() Method
- LocalConnection Class
- LocalConnection.allowDomain() Event Handler
- LocalConnection.close() Method
- LocalConnection.connect() Method
- LocalConnection.domain() Method
- LocalConnection.onStatus() Event Handler
- LocalConnection.send() Method
- 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.addListener() Method
- Mouse.hide() Method
- Mouse.onMouseDown() Listener Event
- Mouse.onMouseMove() Listener Event
- Mouse.onMouseUp() Listener Event
- Mouse.removeListener() Method
- Mouse.show() Method
- MovieClip Class (1/2)
- MovieClip Class (2/2)
- MovieClip._alpha Property
- MovieClip.attachMovie() Method
- MovieClip.beginFill() Method
- MovieClip.beginGradientFill() Method (1/2)
- MovieClip.beginGradientFill() Method (2/2)
- MovieClip.clear() Method
- MovieClip.createEmptyMovieClip() Method
- MovieClip.createTextField() Method
- MovieClip._currentframe Property
- MovieClip.curveTo() Method
- MovieClip._droptarget Property
- MovieClip.duplicateMovieClip() Method
- MovieClip.enabled Property
- MovieClip.endFill() Method
- MovieClip.focusEnabled Property
- MovieClip._focusrect Property
- MovieClip._framesloaded Property
- MovieClip.getBounds() Method
- MovieClip.getBytesLoaded() Method
- MovieClip.getBytesTotal() Method
- MovieClip.getDepth() Method
- MovieClip.getURL() Method
- MovieClip.globalToLocal() Method
- MovieClip.gotoAndPlay() Method
- MovieClip.gotoAndStop() Method
- MovieClip._height Property
- MovieClip.hitArea Property
- MovieClip.hitTest() Method
- MovieClip.lineStyle() Method
- MovieClip.lineTo() Method
- MovieClip.loadMovie() Method
- MovieClip.loadVariables() Method
- MovieClip.localToGlobal() Method
- MovieClip.moveTo() Method
- MovieClip._name Property
- MovieClip.nextFrame() Method
- MovieClip.onData () Event Handler
- MovieClip.onDragOut() Event Handler
- MovieClip.onDragOver() Event Handler
- MovieClip.onEnterFrame () Event Handler
- MovieClip.onKeyDown () Event Handler
- MovieClip.onKeyUp () Event Handler
- MovieClip.onKillFocus () Event Handler
- MovieClip.onLoad () Event Handler
- MovieClip.onMouseDown() Event Handler
- MovieClip.onMouseMove() Event Handler
- MovieClip.onMouseUp() Event Handler
- MovieClip.onPress() Event Handler
- MovieClip.onRelease() Event Handler
- MovieClip.onReleaseOutside() Event Handler
- MovieClip.onRollOut() Event Handler
- MovieClip.onRollOver() Event Handler
- MovieClip.onSetFocus() Event Handler
- MovieClip.onUnload() Event Handler
- MovieClip._parent Property
- MovieClip.play() Method
- MovieClip.prevFrame() Method
- MovieClip.removeMovieClip() Method
- MovieClip._rotation Property
- MovieClip.setMask() Method
- MovieClip.startDrag() Method
- MovieClip.stop() Method
- MovieClip.stopDrag() Method
- MovieClip.swapDepths() Method
- MovieClip.tabChildren Property
- MovieClip.tabEnabled Property
- MovieClip.tabIndex Property
- MovieClip._target Property
- MovieClip._totalframes Property
- MovieClip.trackAsMenu Property
- MovieClip.unloadMovie() Method
- MovieClip._url Property
- MovieClip.useHandCursor 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
- new Operator
- 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.addProperty Method
- Object.constructor Property
- Object.hasOwnProperty() Method
- Object.__proto__ Property
- Object.registerClass() Class Method
- Object.toString() Method
- Object.unwatch() Method
- Object.valueOf() Method
- Object.watch() 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.addListener() Method
- Selection.getBeginIndex() Method
- Selection.getCaretIndex() Method
- Selection.getEndIndex() Method
- Selection.getFocus() Method
- Selection.onSetFocus() Listener Event
- Selection.removeListener() Method
- Selection.setFocus() Method
- Selection.setSelection() Method
- setInterval() Global Function
- setProperty() Global Function
- SharedObject Object
- SharedObject.data Property
- SharedObject.flush() Method
- SharedObject.getLocal() Method
- SharedObject.getSize() Method
- SharedObject.onStatus() Event Handler
- Sound Class
- Sound.attachSound() Method
- Sound.duration Property
- Sound.getBytesLoaded() Method
- Sound.getBytesTotal() Method
- Sound.getPan() Method
- Sound.getTransform() Method
- Sound.getVolume() Method
- Sound.id3 Property
- Sound.loadSound() Method
- Sound.onLoad() Event Handler
- Sound.onSoundComplete() Event Handler
- Sound.position Property
- Sound.setPan() Method
- Sound.setTransform() Method
- Sound.setVolume() Method
- Sound.start() Method
- Sound.stop() Method
- _soundbuftime Global Property
- Stage Object
- Stage.addListener() Method
- Stage.align Property
- Stage.height Property
- Stage.onResize() Listener Event
- Stage.removeListener() Method
- Stage.scaleMode Property
- Stage.showMenu Property
- Stage.width Property
- startDrag() Global Function
- stop() Global Function
- stopAllSounds() Global Function
- stopDrag() Global Function
- #strict Pragma
- 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
- super “Operator”
- System Object
- System.capabilities Property
- System.security.allowDomain() Method
- System.showSettings() Method
- System.useCodepage Property
- targetPath() Global Function
- tellTarget() Global Function
- TextField Class
- TextField.addListener() Method
- TextField._alpha Property
- TextField.autoSize Property
- TextField.background Property
- TextField.backgroundColor Property
- TextField.border Property
- TextField.borderColor Property
- TextField.bottomScroll Property
- TextField.condenseWhite Property
- TextField.embedFonts Property
- TextField.getDepth() Method
- TextField.getFontList() Class Method
- TextField.getNewTextFormat() Method
- TextField.getTextFormat() Method
- TextField._height Property
- TextField.hscroll Property
- TextField.html Property
- TextField.htmlText Property
- TextField.length Property
- TextField.maxChars Property
- TextField.maxhscroll Property
- TextField.maxscroll Property
- TextField.multiline Property
- TextField._name Property
- TextField.onChanged() Event Handler and Listener Event
- TextField.onKillFocus() Event Handler
- TextField.onScroller() Event Handler and Listener Event
- TextField.onSetFocus() Event Handler
- TextField._parent Property
- TextField.password Property
- TextField.removeListener() Method
- TextField.removeTextField() Method
- TextField.replaceSel() Method
- TextField.restrict Property
- TextField._rotation Property
- TextField.scroll Property
- TextField.selectable Property
- TextField.setNewTextFormat() Method
- TextField.setTextFormat() Method
- TextField.tabEnabled Property
- TextField.tabIndex Property
- TextField._target Property
- TextField.text Property
- TextField.textColor Property
- TextField.textHeight Property
- TextField.textWidth Property
- TextField.type Property
- TextField._url Property
- TextField.variable Property
- TextField._visible Property
- TextField._width Property
- TextField.wordWrap Property
- TextField._x Property
- TextField._xmouse Property
- TextField._xscale Property
- TextField._y Property
- TextField._ymouse Property
- TextField._yscale Property
- TextFormat Class
- TextFormat.align Property
- TextFormat.blockIndent Property
- TextFormat.bold Property
- TextFormat.bullet Property
- TextFormat.color Property
- TextFormat.font Property
- TextFormat.getTextExtent() Method
- TextFormat.indent Property
- TextFormat.italic Property
- TextFormat.leading Property
- TextFormat.leftMargin Property
- TextFormat.rightMargin Property
- TextFormat.size Property
- TextFormat.tabStops Property
- TextFormat.target Property
- TextFormat.underline Property
- TextFormat.url Property
- toggleHighQuality() Global Function
- trace() Global Function
- typeof Operator
- 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.getBytesLoaded() Method
- XML.getBytesTotal() Method
- 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 (1/2)
- XMLSocket Class (2/2)
- 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
- Part III
- Resources
- Latin 1 Character Repertoire and Keycodes (1/2)
- Latin 1 Character Repertoire and Keycodes (2/2)
- Backward Compatibility and Player Build Updates
- Differences from ECMA-262 andJavaScript
- HTML Support in Text Fields
- Support for GET and POST
- Flash UI Component Summary
- Embedding a Flash Movie inaWebPage
- Index (1/8)
- Index (2/8)
- Index (3/8)
- Index (4/8)
- Index (5/8)
- Index (6/8)
- Index (7/8)
- Index (8/8)
Product information
- Title: ActionScript for Flash MX: The Definitive Guide, Second Edition
- Author(s):
- Release date: December 2002
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596003968
You might also like
book
ActionScript 3.0 Game Programming University, Second Edition
Learn ActionScript 3.0 the fun way, by creating 16 great games: real, robust games - not …
book
Essential ActionScript 3.0
ActionScript 3.0 is a huge upgrade to Flash's programming language. The enhancements to ActionScript's performance, feature …
book
AdvancED ActionScript 3.0 Animation
This book is a compilation of advanced ActionScript 3.0 animation techniques for any user creating games, …
book
ActionScript 2.0 Language Reference for Macromedia® Flash® 8
The ActionScript 2.0 Language Reference for Macromedia Flash 8 is a comprehensive reference manual that describes …