Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Beginning ActionScript 2.0 2006

.pdf
Скачиваний:
104
Добавлен:
17.08.2013
Размер:
12.47 Mб
Скачать

cssTest.fla file

cssTest.fla file, 454–455 CuePoints for Flash video, 500, 510 curly braces ({ })

Auto Format preferences, 12, 118 automatic indentation and, 9

for code blocks, 9

after function declarations, 84 separate lines for, 118

surrounding compound statements, 20 currentFps event, 505

currentFps property, 516

_currentframe property, 174 curves, drawing, 325, 327–329 curveTo() method

drawing a Bezier curve, 327–329 overview, 325

parameters (table), 325

setting control and anchor points for, 328 custom classes

composition, 686–695 constructors, 662, 665–669 creating, 661–663

defining methods for, 669–675 defining properties for, 675–681 HelloWorldClass example, 662–663 managing data with, 121–122 MyClass example, 661–662

public versus private properties and methods, 663–665

setting styles using, 283, 287 SpinEffect example, 687–690 static methods for, 682–686 StringLib example, 683–686 subclassing, 681–682

ThumbnailButton example, 666–669, 670–675, 677–681

custom functions

best practices, 129–133

declaring return values for, 130–131 duplicating code, avoiding, 133 entanglement, avoiding, 131–132

hard-coded movie clip references, avoiding, 130 key detect example, 131–132

oversized, avoiding, 131

refactoring problematic code, 132, 133–140 strong typing for arguments, 129–130

D

data binding

bindable properties and, 277 Component Inspector panel for, 275–277

defined, 273 direction of, 276

using XML file as data source, 277–281 ways of setting up, 273

data latency, 524, 545

data queue example, 690–695 data sources

XML files as, 277–281

XML schema for, 277, 278, 279, 281

data types. See also strong typing; specific data types arrays and, 40

assignment and, 35 built-in data types, 33–34 case of names, 110 class-based versions, 662

compiler errors for wrong data type, 85 components represented by, 34 composite, defined, 34

for constants, 30 declaring variables and, 28 defined, 30

duplicating data for composite data types, 36–37 primitive, defined, 34

primitive versus composite, 34–35 shared objects and, 584

suffixes suggested for (table), 111–112 type casting, 112–113

dataFile1.xml file, 692 dataFile2.xml file, 692 dataFile3.xml file, 692 DataGrid component, 233, 277, 282

dataHandler() function, 691–692, 694 DataHolder component, 231

DataSet component, 231 dataThumbnail.fla file, 448–450 Date class, displaying methods of, 37–38 Date data type, 34

DateChooser component, 233, 275–277, 287 DateField component, 233, 287

dates

assigning as labels to text field, 116 comparing, 59

deblocking Flash video, 513–514 deblocking method, 514 deblocking property, 506 Debugger panel

image loader code example, 310–311 overview, 306–308

practice using, 308–310 debugging

allowing for SWF files, 15

analyzing program execution and output, 313–314

778

 

domains

by commenting out code, 312–313

depths

compile-time bugs, 297–298

encapsulated in Movie Clip instances, 8

Debugger panel for, 306–310

exported layers converted to, 8

developing a theory, 305–306

getNextHighestDepth() method, 179

developing for, 303–304

for movie clips, 179

domain policies and, 564–565

for programmatically added content, 8

fence post errors, 301

deringing Flash video, 514

global variable challenges for, 95, 119

detecting

infinite loops, 78–79, 302

Flash Player version, 16–17

listing possible errors, 314

motion, 518

logic bugs, 298–299

overlapping Bitmap objects, 360

nested quotes and, 598

overlapping movie clips, 167–168

numerical precision errors, 302–303

developing for debugging, 303–304

off-by-one errors, 76, 301

development environment. See Flash IDE (Integrated

readable code as aid to, 303–304

Development Environment)

revising the theory, 305

directories. See folders or directories

running an experiment, 306–313

disabling keyboard shortcuts for test environment, 66

side effects and challenges for, 96

disk space, managing for shared objects, 587–588

small functions as aid to, 304

DisplacementMapFilter, 345–346

steps in process of, 305

displaying. See also text display properties

strong typing and, 31–33

Camera feed on the stage, 517–521

timeline variable challenges for, 119

code hints, delay before, 10

trace() function for, 311–312, 313

Date class methods, 37–38

uninitialized variables, 299–301

HTML in text fields, 446–448

variable names and, 30

methods for ActionScript classes, 37

deceleration. See easing

properties for ActionScript classes, 37

declaring

variable contents, 28–29

anonymous functions, 87–88

XML in text fields, 446–448

filter properties, 335

dispose() method, 357–358

functions, 84–85

divide-by-zero error, pre-loading movies and, 200

images as bitmaps, 355

docTypeDecl property, 541

return types for custom functions, 130–131

dofscommand.html file, 604, 605

variables, 27–28, 31, 119–120

DOM (Document Object Model) for XML, 549

decode() method, 525

domain() method, 578

decrementNumLives() function, 119–120

domain policies

defineCSSwithAS.fla file, 457–458

debugging and, 564–565

delay before displaying code hints, 10

HTTPS and, 567–568

deleteRows() function, 624, 628

knowing when required, 564

deleting or removing

loading from subfolder, 568–569

array elements, 45

overview, 563

Bitmap object attributes, properties, and data,

relative file paths versus, 564

357–358

secure attribute, 568

clearing graphics, 160, 163, 325

setup for remote domain, 565–566

directories from classpath, 11

setup for single domain, 565

loaded content, 173–174

Web services security and, 567–570

movie clip from stage, 170

wildcard to allow domain access, 566, 567

replacing array elements, 45

with XML Socket, without HTTP, 569–570

symbols from Library, 5

domains

unloading movie clips, 208–209

domain policies, 563–566

delimiters, 525

Flash Security Sandbox and, 563

Index

779

domains (continued)

domains (continued)

super domain, defined, 563

Web services security and, 567–570 wildcard to allow access, 566, 567

dot syntax formats, 37

overview, 37–38, 102

for variables in nested movie clips, 122 double quotes. See quotation marks (“) do..while loops, 72–73

Down state of buttons, 5, 7 download() method, 637, 639 downloading files

base code for, 641 example, 641–645

previous Flash versions and, 637 draw() method, 358, 366 drawBorder property, 680 drawBox() function

elasticized box example, 412, 414, 415–416 refactoring example, 136–137, 138, 140

drawCircle() function, 194, 195 drawDropShadow property, 681 drawGraph() function, 330, 331–333 drawing. See also specific methods

API for, 320

Bezier curves, 325, 327–329 clearing all graphics, 160, 163, 325 creating filled rectangles, 358

filling last closed shape, 160, 164, 324

filling shapes with bitmap contents, 322–323, 334 filling shapes with gradients, 323–324, 334

filling shapes with solid color, 160, 162, 322 graphs, 329–333

methods, 320–325

moving the drawing position, 161, 170, 324 setting line properties, 160, 168–169, 320–322 simple square, 326–327

straight lines, 160, 169, 325 drawing API. See also drawing

animating with, 425–432 keyboard shortcuts, 763–769 overview, 320

drawScreen() function, 241

drawThumbnail() method, 669, 671–672, 673–674, 678–679

DropShadowFilter

applying multiple filters, 347–349 described, 336

properties, 336–337

_droptarget property, 174 duplicateMovieClip() method, 160, 163–164 duplicating. See also copying

avoiding for code, 133

data for composite data types, 36–37 refactoring problematic code and, 133–140

duration property

Sound class, 480

Tween class, 410

dynamic text fields, creating, 435–436. See also text fields

E

easing

built-in easing classes and methods, 404–405 calculating movie clip positions, 388, 392 defined, 387

easing in (acceleration), 391–395 easing out (deceleration), 387–391

interactive example easing out and in, 396–402

Edit menu

keyboard shortcuts, 761, 763–764 Preferences command, 1, 9

elasticized box example bouncing into position, 411–414 multiple tweens with, 414–417

Embed tag

adding FlashVars to, 590–591 allowScriptAccess parameter, 603, 619, 628 nesting within Object tag, 589

parameters, 589–590 enabled property, 175

endFill() method (drawing API)

Bezier curve example, 327

graph building example, 330, 331, 333 overview, 324

endFill() method (movie clip), 160, 164 entanglement

avoiding, 131–132

refactoring problematic code, 133–140 erasing. See deleting or removing errors. See also debugging

compiler errors for wrong data type, 85 compile-time bugs, 297–298

fence post errors, 301 infinite loops, 77–79, 302 listing possible errors, 314 logic bugs, 298–299

numerical precision errors, 302–303

780

File menu

off-by-one errors, 76, 301

onLoad() event handler codes for, 544–545 uninitialized variables, 299–301

escape() function, URL encoding and, 528 event handlers. See also event listeners; events

animated masking effect example, 193 game keystroke-handling example, 64–66 LoadVars class, 529

mouse-driven masking effect example, 194 onRelease event for simple button, 181, 183–184 pre-loader, 193

XML class, 541–542

event listeners. See also event handlers; events adding to image viewer, 257–262

attaching multiple listeners to multiple components, 262–270

creating listener functions, 255–257 creating listener objects, overview, 247–249

creating listener objects, radio button and check boxes example, 250–254

creating listener objects, simple button example, 249–250

creating listener objects, using an existing object, 254–255

deciding which technique to use, 257 defined, 66, 247

documentation for accessing event data, 249 game keystroke-handling example, 64–66 handling events from multiple sources, 264–265

handling multiple events from same component, 248 for Loader and ProgressBar components, 215–216

in monolithic movie pre-loading strategy, 218–219, 220 properties of event objects and, 248–249

registering to a component, 248

structuring code for multiple listeners, 263–264 using the stage as, 254–255

events. See also event handlers; event listeners

Camera class, 516

documentation for accessing event data, 249 event sounds, 483

FileReference class (table), 640–641

handling multiple events from same component, 248 inheritance and, 106

JavaScript (table), 607

Loader component (table), 213 LocalConnection class (table), 578 manually triggering, 270–271 Microphone class (table), 491 MovieClip class (table), 177 MovieClipLoader class (table), 206

netStream class, 505–506 ProgressBar component (table), 214 SharedObject class, 583

Sound class (table), 476

Tween class (table), 411

XMLSocket class (table), 554

exercise answers, 699–758 exporting. See also publishing projects

Flash video to other formats, 503–504

Flash video wrapped in SWF file, 502–503

expressions building, 55–59

comparing dates, 59 comparing values, 55–56 in conditionals, 53, 54 defined, 53

modifying program behavior, 56–57 order of operator evaluation in, 57–58 simple examples, 54–55

values possible for, 54 extends keyword, 682

External API. See also ExternalInterface class

calling ActionScript functions from JavaScript, 615–616 calling ActionScript methods from JavaScript, 616–617 calling JavaScript functions from ActionScript, 617–620 overview, 612

external files. See also importing; loading; pre-loading movies

#include directive for, 151–152, 153 keeping code in, 151–153

refreshing data, usability concerns and, 523–524

ExternalInterface class available property, 615 creating pop-up windows, 630

defining window parameters, 632–633 designating SWF files as trusted content, 595,

596–597 methods, 612–614

pop-up window launcher example, 633–634 security alert window for, 595–596

F

fence post errors, 301 fforward() method, 405, 407 Fibonacci sequence, 68

File menu

Import submenu, 146 keyboard shortcuts, 760, 763 Publish command, 13

Index

781

file size

file size

components and, 237 compressing SWF files, 15 JPEG Quality setting and, 15

FileReference class events (table), 640–641 methods, 637–640 properties (table), 640

fillColor property, 366 fillRect() method, 358 fills

beginBitmapFill() method for, 322–323, 334 beginFill() method for, 160, 162, 322, 326–327 beginGradientFill() method for, 323–324, 334 endFill() method for, 160, 164, 324 fillRect() method for, 358

floodFill() method or, 358–359 filters

applying multiple filters, 346–351 applying to Bitmap object, 356 applying to movie clip, 335 BevelFilter, 338

BlurFilter, 337 cloning, 346

ColorMatrixFilter, 343–345 constructor parameters for, 335 ConvolutionFilter, 340–343 declaring properties for, 335 DisplacementMapFilter, 345–346 DropShadowFilter, 336–337 ease of using, 335

GlowFilter, 337–338 GradientBevelFilter, 339–340 GradientGlowFilter, 339 overview, 335

performance and, 197

pinhole camera look using, 349–351 filters property, 176, 335 findAHrefLinks() function, 532 findPixel() function, 520, 521 finish property, 410

firstChild property, 541

Flash authoring tool. See Flash IDE (Integrated Development Environment)

Flash Communication Server

attaching audio to netStream object, 494 Camera object and, 517

streaming video deployment, 498

Flash Detection Kit, 16–17

Flash 8 Video Encoder

converting video to FLV, 501–502 creating Flash video, 500

Flash IDE (Integrated Development Environment)

Actions panel, 8–9

ActionScript preferences, 9–12

Auto Format preferences, 12–13, 118 drawing API, 320

Flash Detection Kit, 16–17 Flash movies versus, 1 keyframes and animation, 3–4 Library, 4–5

panel system, 1 Properties panel, 2, 3 publishing projects, 13–16 start page, 1, 2

symbols, 4–8 timeline, 3 Tools panel, 2, 3

Flash JavaScript Integration Kit

calling ActionScript functions from JavaScript, 609–612 calling JavaScript functions from ActionScript, 608–609 obtaining, 607

overview, 607 setting up, 608

Flash movies. See Flash video; SWF files

Flash Only HTML template, 16

Flash Player

defined, 1

detection options, 16–17

System object limitations and versions of, 655 targeting versions of, 14

Flash video

Camera object for, 515–522 compositing with movie clips, 511–513 controlling video position, 508–510 controlling video quality, 513–514 converting other formats to, 501–502 converting to SWF, 500

creating, 500 CuePoints, 500, 510 data rate, 497–498 deblocking, 513–514 deringing, 514

exporting to other formats, 503–504 Flash 8 Video Encoder for, 500, 501–502 frame rate, 499–500

interlacing, 499 keyframes for, 498–499

782

frames

loading external files, 504–508 On2 codec, 502

playing in a movie clip, 507–508 post-processing, 513 progressive, 497, 498 rotoscoping, 511

scaling, 514 streaming, 498

SWF video versus, 497 transparency in, 510–511, 514 variable bit rate compression, 499 wrapping in SWF file, 502–503

Flash wrappers defined, 653

Flash browser plug-in as, 653

for Flash video over HTTP, 498, 502–503 HTML wrapper settings, 15, 16

launching programs using fscommand(), 656–658 Projector wrapper, 653

SDK for, 653, 658 third-party, 653, 658–659

FlashJSKit.html file, 610–611

FlashtoJS.fla file, 600–602

FlashType (Saffron), 433

FlashVars

adding to Object and Embed tag, 590–591 creating with JavaScript, 591–592 defined, 588

Object and Embed tag parameters, 589–590 passing via a servlet page, 593

flashVarsTest.fla file, 591 flashVarsTest.html file, 591–592 floodFill() method, 358–359 flush() method

managing disk space for shared objects, 587–588 overview, 582, 583

user settings and, 587

FLV. See Flash video

FLV Playback component, 231–232 focused code, 106 focusEnabled property, 176

_focusrect property, 174 folders or directories

for bitmap images in project directory, 145 deleting from classpath, 11

library, recommended setup, 143–144 fonts

embedding, 434

global component styles for, 282 preferences for code, 10 recommendations for code, 10

sharing at runtime, 450–452 system versus embedded, 434 fontSource.fla file, 450–452 fontSource.swf file, 451, 452

for loops

animation speed and, 377

assigning IDs to dynamically created movie clips, 126–129

data tracking example, 73–76 Fibonacci sequence example, 68 graph building example, 330, 333 init portion, 67

iterator variables, 67, 108

for managing arrays, 67–68, 76

for movie clip creation and initialization, 68–69 naming variables for indices, 67

overview, 66–69 syntax, 66–67

while loop duplicating, 71 while loops versus, 71, 72 for..in loops, 69–70, 347

formatEmailAddress() function, 84–85 formatting code

Auto Format preferences, 12–13, 118 automatic indentation option, 9 indentation tab size option, 10 overview, 118–119

white space for, 25–26, 118–119

ForwardButton component, 232

fps (frames per second). See frame rate or fps (frames per second)

fps property of Camera class, 516

FPS property of Tween class, 410 frame placeholders, inserting, 3–4 frame rate or fps (frames per second)

choosing for animations, 379–380 common refresh rates, 379

deciding between onEnterFrame() and setInterval(), 379

default rate, 376 defined, 370

effect on animation, 376–377 experimenting with, 378–379 Flash video and, 499–500

onEnterFrame() function and, 376 setInterval() function and, 377 upper limit for, 380

frames. See also frame rate or fps (frames per second); keyframes

defined, 370

frame-based versus time-based animation, 376–380

Index

783

frames (continued)

frames (continued)

going to and playing, 167 inserting, 3–4

interlaced video frames, 499 single frame application, 154–156 white versus gray on timeline, 4

_framesloaded property, 174 fscommand event (JavaScript), 607 fscommand() method

calling JavaScript functions using, 602–604 calling projector functions using, 656–658 command and parm values, 656–657 Flash JavaScript Integration Kit versus, 612 getURL() method versus, 603, 604 launching programs using, 657–658 overview, 656

fscommandtoJS.fla file, 604, 605, 606 full screen sites, performance and, 197 fully qualified addresses for URLs, 186, 187

Function data type, 87–88 function keyword, 84

functions. See also custom functions; specific functions access functions for variables, 120–121

anonymous, 87–88, 94–95 applying filters using, 348–349

arguments (input parameters), 83, 84 assigning to onRelease event, 176–177 calling, 84–85

calling from a hyperlink, 452–453 declared within another function, 94–95 declaring functions, 84–85

declaring variables in, avoiding, 119 defined, 83

delayed action and, 88–89 general form, 84

JavaScript, calling using fscommand(), 602–604 JavaScript, calling within Flash, 598–599, 600–602 modifying arguments passed in, 97–98

naming, 84, 110 overview, 83–86, 98–99

passing as arguments, 88–92 returns, 83

reusability and, 87 side effects of, 96–98

small, debugging aided by, 304 straight code versus, 86–87 as variables, 88

G

Gaussian blur matrix

ConvolutionFilter example using, 342–343 9x9 kernel, 341

gaussianBlur.fla file, 342–343 generateFilterRect() method, 359 get() method

Camera class, 515, 517

Microphone class, 490

GET method (HTTP)

LoadVars send() method and, 526 LoadVars sendAndLoad() method and, 527 overview, 558

POST method versus, 558–559 using with XML, 557–559

getBytesLoaded() method load listener function and, 472 LoadVars class, 525, 526 movie clip, 160, 164–165

pre-loader examples, 165, 199–200 pre-loading XML, 546, 547, 548 Sound class, 474

XML class, 538, 539

getBytesLoaded property (XML object), 545 getBytesTotal() method

load listener function and, 472 LoadVars class, 525, 526 movie clip, 160, 165–166

pre-loader examples, 165–166, 199–200 pre-loading XML, 546, 547, 548

Sound class, 474

XML class, 538, 539

getBytesTotal property (XML object), 545, 548 getColorBoundsRect() method, 359 getCurrentTime() function, 85 getFieldValue() function (JavaScript), 620 getFormFields() function side effect, 98 getLocal() method

overview, 582–583

shared objects as cookies example, 585 sharing shared objects, 588

getNextHighestDepth() method, 179, 385 getPan() method, 475, 483 getPercentLoaded() function, 546, 547 getPixel() method, 359–360, 366–368 getPixel32() method, 360 getProgress() method, 206, 207

784

htmlInFlash.fla file

getRGB() function, 10, 521 getSize() method, 582 getters

defined, 676

photo thumbnail class example, 680 retrieving property values, 676

uses for, 676–677 getTextFormat() method, 440 getTime() function, 59 getTransform() method, 475 getURL() function

basic form, 166

creating pop-up windows, 629–630 defining window parameters, 632 getURL() method versus, 166–167 overview, 166

pop-up window launcher example, 633–634 getURL() method

basic form, 166

calling JavaScript using, 598–599, 600–602 Flash JavaScript Integration Kit versus, 612 fscommand() method versus, 603, 604 getURL() function versus, 166–167 limitations for JavaScript, 602

overview, 160, 166, 598 getVariable method (JavaScript), 606 getVolume() method, 475, 483

_global keyword

declaring global variables using, 92 minimizing use of, 39, 95

global variables

access functions for, 120–121 declaring in one place, 119–120 defined, 92

memory use by, 95, 119 minimizing use of, 39, 95

_global.style variable, 282

_global.styles variable, 283 GlowFilter

described, 337

pinhole camera look using, 349–351 properties, 337–338

gotoAndPlay() function, 167 gotoAndPlay() method, 160, 167 gotoAndStop() method

described, 149

in gotoScreen() function, 152 labels with, 149, 150

managing screen state with frames, 150

gotoFrame method (JavaScript), 606 gotoScreen() function

in split-up movie pre-loading strategy, 222–223, 224 switching screens using frames, 152–153 switching screens using movie clips, 155, 156

GradientBevelFilter, 339–340

GradientGlowFilter, 339

Graphic symbols, 5

graphs, building, 329–333 greater than operator (>), 55

greater than or equal to operator (>=), 55–56

H

handleButtonClick() function, 127, 128–129 handleData() method, 691, 694 handleLoad() function, 306, 312, 313 handleStart() function, 90, 91–92 handleStop() function, 90, 92

hard-coded movie clip references avoiding in functions, 130

refactoring problematic code, 133–140 hasChildNodes() method, 538, 539

HeaderDateText class, 287 height property

bitmapData object, 365 Camera class, 516 Video class, 506

_height property

MovieClip class, 174

Video class, 507

helicopter animation project, 396–402

HelloWorldClass.as file, 662–663

Help menu keyboard shortcuts, 769

Help panel, 284

Hit state of buttons, 5 hitArea property, 176 hitTest() method

Bitmap object, 360 movie clip, 160, 167–168

HTML

calling functions from hyperlinks, 452–453 displaying, 446–448

enabling in a text field, 447 FlashVars, 588–593

image and SWF support in HTML text fields, 448–450 options for SWF file wrappers, 15

tags supported in Flash, 446

in XML elements, CDATA wrapper for, 537 htmlInFlash.fla file, 447–448

Index

785

HTTP

HTTP

data rate for video and, 498

POST and GET methods, 526, 527, 557–559 progressive video with, 497, 498

wrapping video in SWF file for, 498, 502–503

HTTPS, 567–568

hyperlinks, calling functions from, 452–453

I

IDE. See Flash IDE (Integrated Development

Environment)

IDs

assigning to dynamically created movie clips, 126–129 for associative array rows, 75

linkage, for movie clips, 153, 182 if..then..else statements

logic errors, 298–299 nesting, 60

overview, 59–60 shorthand, avoiding, 119

switch..case statement compared to, 60–61 trace() function for debugging, 311

ignoreWhite property, 541, 542, 547 image viewer project. See tryItOut_

scriptingComponents project imageClipLoaderTest.fla file, 473–474 imageLoadTest.fla file, 472

images. See bitmap images; drawing; vector graphics implicit instantiation, 104, 105

import statement, 238 importing

bitmap images to library, 146–147 classes, 238–239

LoadVars class for, 524 packages, 238, 240–241, 411 sound object, 477

SWF file Protect From Import attribute and, 15 video files, 503

#include directive, 151–152, 153 increment operator, 21 incrementNumber() function

with side effect, 96–97 without side effect, 97

indentation automatic, 9

tab size option, 10 index property, 516 indexOf() method, 533 indices

of arrays, 40

of associative arrays, 46

zero as starting integer for arrays, 40, 76 infinite loops

debugging, 78–79, 302 defined, 77

while loop examples, 77–78 inheritance

defined, 106 overview, 106

of setStyle() method for components, 282 subclassing and, 681–682

init() function

attaching movie clips with, 155

controlling embedded component with JavaScript example, 622, 625

debugging examples, 305–306, 308–309, 312, 313 declaring variables in a container object, 120 declaring variables in one place, 119–120

image viewer example, setting properties using code, 243–244

image viewer example, setting styles, 288–290 image viewer example, with event listener, 258–259,

260–261

image viewer example, with multiple listeners, 267, 269

image viewer example, with XMLConnector, 280, 281 loading XML files and extracting values, 550

screen saver example, 426–427, 430

in split-up movie pre-loading strategy, 223, 224–225 initTraces() function, 427, 430

inline comments, 26, 117

input text fields, creating, 435–436. See also text fields Insert menu

keyboard shortcuts, 765 New Symbol command, 4, 6 Timeline submenu, 3, 4, 151

inserting

frame placeholders, 3–4 frames, 3–4

keyframes, 4, 151 symbols, 4

instances, 104. See also objects instantiation

of classes, constructors and, 662, 665–669 defined, 104

implicit, 104, 105

new operator for, 104–105

Integrated Development Environment. See Flash IDE

(Integrated Development Environment)

interframes, 498–499 interlaced video, 499

786

layers

Internet resources

Flash JavaScript Integration Kit, 607 free socket server, 554, 555 Northcode Flash wrappers, 653

invokePlay() function, 134, 135, 137, 138 invokeStop() function, 134, 135–136, 137, 138

IsPlaying method (JavaScript), 606 isTimeValid() function, 87 iterator variables, 67, 69, 108

J

JavaScript. See also External API; Flash JavaScript Integration Kit

calling ActionScript functions using External API, 615–616

calling ActionScript functions using integration kit, 609–612

calling ActionScript methods using External API, 616–617

calling Flash from, 604–606

calling functions using External API, 617–620 calling functions using fscommand(), 602–604 calling functions using integration kit, 608–609 calling functions with call(), 614

calling functions within Flash, 597–602 controlling an embedded component, 621–629 creating FlashVars with, 591–592

events (table), 607 External API for, 612–629 Flash Detection Kit and, 17

Flash JavaScript Integration Kit for, 607–612 getURL() method for calling, 598–599, 600–602 methods (table), 606–607

nesting variables within a String, 598

opening browser windows, 618–619, 629–634 registering ActionScript functions as callable from,

612–613, 615, 616–617 security settings, 595–597

setting and getting data using ActionScript, 619–620 window.open() method, 629

wrapper function for window.open() method, 630–631

javascript keyword, 599 join() method

loading and parsing raw text, 532, 533 overview, 42, 43

split() method versus, 43

JPEG Quality setting, 15

JStoFlash.html file, 605, 606 justifying text, 440

K

kerning property for text, 441 key detect function, 131–132 keyboard shortcuts

Actions panel, 762

Control menu, 762, 767–768 disabling for test environment, 66 drawing IDE, 763–769

Edit menu, 761, 763–764

File menu, 760, 763

Help menu, 769

Insert menu, 765

integrated script editor, 760–762 Modify menu, 765–767

Text menu, 767

Tools menu, 761

Tools panel, 759–760

View menu, 761, 764–765

Window menu, 768–769

keyframes

adding script to, 8, 9 circles on timeline for, 4

creating animations using, 370–371 defined, 4, 370

for Flash video, 498–499 inserting, 4, 151 interframes and, 498–499

managing screen state with, 149–151 for navigating between screens, 149–151 temporal compression and, 498

keywords. See also specific keywords not allowed for names, 29, 108–109 reserved words (tables), 109

L

Label component

for application title, 241

data binding with DateChooser component, 275–277 described, 234

placing on the stage manually, 237 placing on the stage with script, 241 labels. See also Label component; names

assigning to text fields, 116, 181

with gotoAndStop() method, 149, 150 lastChild property, 541

latency, 524, 545

launching programs using fscommand() method, 657–658

layers, 8, 149

Index

787