Date post: | 08-Dec-2016 |
Category: |
Documents |
Upload: | truongtram |
View: | 240 times |
Download: | 17 times |
If you can't read please download the document
Macromedia*Flash MX
Action Script
Bible
Robert Reinhardt,and Joey Lott
WILEY
Wiley Publishing, Inc.
Macromedia8
Rash MXAction Script
MacromediaFlasH MXActionScript
1
"" - * 2003
32.973.26-018.2.7535
681.3.07
"". ..
.4.. , .. ..
"" :[email protected], http://www.dialektika.com
, , , .
35 Macromedia Flash MX ActionScript. . : . . . : - "", 2003. 1280 . : . . . .
ISBN 5-8459-0480-3 (.) Internet, -
Web-, , Web-. - ActionScripl, . , , - -.
32.973.26-018.2.75
- .
, , - , JohnWiley&Sons, Inc.
Copyright 2003 by Dialektika Computer Publishing.Original English language edition Copyright 2002 by Wiley Publishing. Inc.
All rights reserved including the right of reproduction in whole or in part in any form. This translation publishedby arrangement with Wiley Publishing, Inc.
ISBN 5-8459-0480-3 (.)ISBN 0-7645-3614-1 (.)
- "", 2003 Wiley Publishing, Inc., 2002
40
I. FLASH MX 47
1. Flash MX 48
2. Web- 60
3. Flash- 78
II . ACTIONSCRIPT 97
4. ActionScript. 98
5. ActionScript 123
6. 157
7. 180
8. ActionScript 217
9. ActionScript 236
III . 277
10. MovieClip Button 278
11. Array 324
12. 342
13. Math 356
14. Date 369
15. String 390
16. Stage Listener 407
17. System Capabilities 424
18. TextField, TextFormat Selection 442
19. Mouse Key 506
20. Color 548
21. Sound 563
22. SharedObject LocalConnection 605
23. XML LoadVars 622
24. XMLSocket 655
25. RegExp 667
IV. 685
26. 686
27. 717
28. 749
V. FLASH 779
29. Flash Web- 780
30. 805
31. Flash- Director Lingo 827
32. Flash- Pocket PC 858
33. Flash- 881
34. Flash Player 900
VI. FLASH-, 921
35. 922
36. 977
37. Flash- 1018
38. 1052
39. : Flash- 1085
40. Flash Remoting 1112
41. 1152
VII. 1207
42. 1208
43. ActionScript 1234
VIII . 1249
. - 1250
. 1254
1257
40
I. FLASH MX 47
1, Flash MX 48 Flash MX 48 Flash MX 49 Flash MX 50
50 50 Actions 51
ActionScript 51 51- 51 Flash 52 52
Flash Player 52 Unicode 52 53 53
53 53 54 54 54
Flash 54 55 , Flash MX 56 Flash 56
Flash MX 57 Flash 58 59
2. Web- 60 Flash Web 60
60 Flash Player 62 Flash 63
Flash? 63 Flash 65
67DHTML 67XML XSL 67SVG 67Macromedia Shockwave Director 68SMIL, RealPlayer QuickTime 68Macromedia Authorware 68Microsoft PowerPoint 69
69HTML - 69 JavaScript 70
71 71 "-" 73XML 74
- 75^ 75
75 76 76
76
3. Flash- 78 Flash- 78 Flash- , 79
79 80 - 81 83
Flash- 84 Flash : HTML- 84 Flash : HTML- 84
85 86
DHTML Flash 86 86
87 87
88 88
SWF 88 89 90
90 90
Flash- 90 , 90 92
92 92
93 94
95
II. ACTIONSCRIPT 97
4. ActionScript. 98 ActionScript? 98
ActionScript 99 ActionScript: 100 ? 101
102, 103 MovieClip 103
8
Actions 104 Script Navigator 106 Actions Toolbox 106 Script 107 107
( Script) 108 109
109 111 111 Reference 114
Actions 115 ActionsPanel.xml 116
116 116 116 117 118 118 ActionsPanel.xml 118
AsColorSyntax.xml 120 120 120 , 120
AsCodeHints.xml 120 121 121 121
122
5. ActionScript 123 124
125 126
126 126
128 129 130 131 131 null 133 undefined 133
133 133 134
134 134 135 137 137 139 140
9
?: 144 typeof 145
145 146
" " 147, 147
if 147 while 148 for 149 break 151 continue 151 switch 152
153 154 156
6. 157 157 158
159 161 162 163
163 164
165 165 165 168
169 169 170
171 172
getTimer() 173 getVersion() 173 setlntervalQ clearlntervalQ 173
, 176 Function 177
arguments 177 caller 178 178 length 179
call apply 179 179
7. 180 180
- 181 181
182 183
184 185
10
185 185 186
186 with 187
MovieCHp 188 189 189
189 190
190 191 191
prototype _proto_ 193 instanceof 193 194 194 195
196 super 197 constructor 200 200
Object 202 202 204 208 watch() 208 toStringO valueOf() 212 CustomActions 213 XML-, 213 214 215 216
216
8. ActionScript 217 ActionScript 217 #include 218
219 ActionScript 220
220 ActionScript 222
222 222 223
223 Dreamweaver MX 223 Actions 224 Notepad SimpleText 224 EditPlus 225
226 Cliptext 228 229
11
HomeSite 229 230 231 232 233
BBEdic 234 234
235
9. ActionScript 236
Flash MX 236 237
238 240
240 () 241 , 242
243 245
246 246 247 - Flash 250
, 251 252
HTML- 255 HTML, Flash MX 256
() 256() 256 () 256 (
) 257 () 257 () 257 () 259 () 260 HTML- 261
HTML 261 HTML 264 asfunction 268 asfunction 269 asfunction 270 Flash- 272
' 275
III. 277
10. MovieClip Button 278 278
278 MovieClip Button 279 279 280 280
281
12
_parent this 281 _root 282
283 MovieClip 286
MovieClip Button 286 287
_ _ 287 _height _width 288 _xscaie _yscale 289 rotation 289 __xmouse _ymouse 290
290 291 292
MovieClip 293 trackAsmenu 293
MovieClip 294 _currcnlframe _totalframes 295 Jroptarget 295 hitArea 295
296 __quility _highqualily 296 _soundbuftime 297
297 297 MovieClip ActionScript 298
Flash- 298 duplicateMovieClipO removeMovieClipQ 299 attachMovie() 301 create Empty Movic{) 302 createTextFieldQ 303 svvapDeplhs() 303 loadMovieQ unloadMovieQ 304 getBytesLoadedQ getBytesTotal() 306
/ Web- 307 getURLO 307 loadVariablesQ 308
, 310 startDragO stopDragO 310 hitTestQ 311 globalToLocalO localToGlobalQ 312 gelBoundsQ 313
314 314
314 316 prototype 318
move() 319 percentLoaded 319 drawCircleQ 319
320 321
323
13
11. Array 324 324 325
326 for 327
327 327 328 329
for..in 330 330 331
332 Array 333
333 334
concatQ 335 sliceQ 335
336 push() 336 unshiftQ 337 () 337 shiftQ 337 spliceO 337
338 sortQ 338 sortOnQ 340 reverseQ 340
341 toStringO 341
341
12. 342 342
342 343 344 345
NumberQ 345 parselntQ parseFloat() 345
346 347
Number 347 Number 347 Number 348
MAXJVALUE MINJVALUE 348 NEGATIVE_INFINITY POSITIVE_INFINITY 348 NaN 349
Number 349 toStringO 349 valueOfQ 350
350 toFixedQ 350
14
toExponentialQ 351 toPrecisionQ 353
Boolean 354 Boolean 354 Boolean 354
toStringO 354 valueOfQ 355
355 desc 355
355
13. Math 356 ActionScript 356 Math 357
with 357 357 358
358 359 360 361 361 ActionScript 362 365
Math 365 degToRad radToDeg 366 plot 366
366 368
14. Date 369 369
370 (UTC) 370 371 ActionScript 371
Date 371 Date 372 Date 374
Get 376 376 376 377 377 , , , 377 377 378
Set 378 378 378 379 , , , 379 380
380
15
381 381 382
Date 382 3S3
384 388
15. String 390 390 391 391 392
394 394 String 394 394
395 396 396 397 397 397 398
399 400
400 402
406
16. Stage Listener 407 407
Stage 40S Stage.scaleMode 410 Slage.align 410 Stage.width 411 Stage.height 411
Rash- 412 scaleMode 412 414
Stage 416 IT Stagc.onResizeQ 416 Stage. addListener(listenerObject) 417 Stage.removeUstener(listenerObject) 417 Listener 417
419 Listener Stage 421
423
17. System Capabilities 424 System 424 System 425
System 425 showSetlings() 426
showSettingsQ 426
16
UseCodepage 427 Capabilities 429
429 Capabilities 430
431 432 434
435 436
Syslem.capabiiities 437 Security 439 System 440 440
18. TextField, TextFormat Selection 442 TextField 442
TextField 444 background 445 border 445 condenseWhite 446 embedFoms 446 html 446 htmlTexi 447 password 448 restrict 448 selectable 449 tabEnabled , 449 tablndex 450 text 451 type 451 variable 452, TextField 452 backgroundColor 453 borderColor 454 textColor 454
, TextField 455 autoSize 455 length 456 maxChars 456 multiline 456 textHeight 456 textWidth 457 wordwrap 457
TextField 457 scroll 458 bottomScroll 459 maxscroll 459 hscroll 460 maxhscroll 460
TextField 460 gctFontListO 460 getTextForniatQ 461 setTextFormatQ 462
17
getNewTextFormatQ 463 setNewTextFormatQ 463 replaceSel ( String) 463 getDepthQ 464 removeTextFieldO 464 addLisfenerQ removeListenerQ 465
TextField 465 onChanged() 465 onKilfFocus(newFocus) 465 onScroller() 466 onSetFocus(oldFocus) 466
Listener TextField. 467 Listener.onChanged() 467 Listener.onScrollerQ 468
TextField 468 TextFormat 469
align 470 blocklndent 470 bold 471 bullet 471 color 471 font 472 indent 472 italic 473 leading 473 leftMargin 473 rightMargin 474 size 474 tabStops 474 target 475 underline 475 url 476
getTextExtent() 476 TextField 477 Selection 4S1
Selection 481 482 483
485 488 489
Flash-, 494 497 499
Font 499 502 SharedObject 503
505
19. Mouse Key 506 506 Mouse 508
Mouse 508
18
Mouse.hideQ 508 Mouse.show() 509
Mouse Listener 509 Listener. onMouseDownQ 509 Listener.onMouseUpO 510 Listener.onMouseMoveQ 510 Mouse.addListener(listener) 510 Mouse. removeLisiener(listener) 511
512 515
515 ActionScript 516
updateAfterEventQ 518 Key 520
Key 521 523
523 Button 524 Movie Clip 526 Key Listener 528 529 getCodeQ 530 530
MovieClip 533 setlntervalQ onKeyDownQ 535 540
Flash- 543 547
20. Color 548 Color . 548
549 550
551 Color 551
setRG () 552 geiRGBO 553 setTransform(transformObject) 554 getTransform() 556
556 559
562
21. Sound 563 Sound 563
Sound 564 565
Sound 568 Sound 568
Sound 569 duration 569 position 569
Sound 570 attachSound(linklD) 570
19
loadSound(URL, isStreaming) 571 getBytesLoaded() 572 getBytesTotalQ 573 onLoad(success) 573
Sound 574 slart(offsct, loopFactor) 574 stopQ 575 onSoundCompleteQ . 575
Sound 575 set Volume (percentage) 576 getVoIumeQ 576 setPan(pan) 576 getPanQ 577 setTransform(transformObjcct) 577 getTransformO 578
579 583 Sound 588 Sound 592 Sound 596 . 598 Sound 602 604
22. SharedObject Local Connection 605 SharedObject 605
cookie 606 SharedObject 606
SharedObject 607 608 610, 611
612 LocaiConnection 615
- 615 616 616
- 616 617 618
618- 618
619 621
23. XML LoadVars 622 XML 622
XML 623 XML 624
624 624
XML 624 XML 625 625
20
627 DTD 627
XML- 628 XML- 630
XML DTD 630 XMLnode 630 631 633 633 , 634
635 XML- DTD 635 636 636 637 63 S 638
XML- 638 XML- 638 XML- 641 642 642
XML- 646 CGI 647 Flash 647
LoadVars 649 LoadVars 650 650 651
Flash- 652 - 653
654
24. XMLSocket 655 655
HTTP 655 656
657 657 658
XMLSocket Flash- 658 659
659 660 661
- 661 JDK 662
Windows 662Macintosh (OS X) 663
663 665
25. RegExp 667 667
21
: 668 , , 668 669
672 673 673 674 674
RegExp 675 675 JavaScript 676 676
RegExp 677 String 681
681 681 681 682
RegExp 682 683
IV. 685
26- 686 686 687 689
CheckBox 690 RadioButton 694
PushButton 700 ComboBox 702 ListBox 70S ScrollBar 710 ScrollPane 711
713 716
27. 717 717 733
, Flash 733 738
FStyleFormat 741 742 FStyleFormat 744
748
28. 749 749
750 750 751
752 754
22
755 756
758 758 #initclip 759 761 Slider 763
765 765 766 768 769
DialButton 770Macromedia Exchange 774
Extension Manager 775 775 1- 775
776 776 776 776 776 777
Dial 777 778
V. FLASH 779
29. Flash Web- 780 Flash JavaScript 781
fscommandO 782 fscommandO 782
782 JavaScript 783ActiveX 785
Flash 785 getURLQ 788 788
JavaScript Flash 790 JavaScript 790
790 791 791 791 791
792 792 792 MovieClip 792 793
TotalFrames 793 JavaScript 793 Flash- JavaScript 797 Flash Player Web- 801
23
Flash 801 802 803
804
30. 805 805
508 806 W3C 806 MSAA 807
807 808
Window-Eyes 808 Flash 809
Accessibility 809 811 812 812 812 812
812 813 814 , 814 System.capabilities.hasAccessibility 815
816 816
Macromedia 817 818
818 820 824
HTML 824 Window-Eyes 825
826
31. Flash- Director Lingo 827 Flash Director 828
Director 828 Director Flash 830
830 831
Director 831 Director Flash 832 Director 833
Director? 836 "" 837
Flash 838 838 Director- 839
841 843
Flash- Lingo 846 Lingo 846
24
getURLQ event: 847 848
Flash FilelO Xtra 849 850
Flash- 852 853
Flash 853 853 854 getURL{) lingo: 855 Director- 855 Flash 855 855 856
857
32. Flash- Pocket PC 858 Pocket PC 859
Flash 859 860
: Flash- 860 , Flash Pocket PC 861
861 Flash MX 863 864 864
Pocket PC 865 865 AclionScript 867 868
Flash Web-: WordFind Pocket PC 869 Flash- 870
870 871
ash- 876 JScript Pocket Internet Explorer 876 Windows 3,0 877 Flash-, 878
Flash- 878 879
33. Flash- 881 881
882 883
FSCommand 884 fscommand() 884 886
886 887 fullscreen allowscale 891
892 894 895
25
Flash- 5 895 899
34. Flash Player 900 Flash-? 900
Web- 900 901 901 902
Flash 903 903 906
primQ . 906 printAsBitmapQ 906
907 bmovie 908 bmax 910 bframe 911
912 912
912 showPrintDialogO printProceed() 914 printButton 915 printWindow 916
917 920
VI. FLASH-, 921
35. 922 922
923 928
928 931
933 scroll 934
938 940
943 943 947
949 950 954 956
959 scrollBar 960 963 () () 965 scrollBar 967
967 967
26
968 970
, 973 deltaX 973 976 deltaXQ Flash- 976
976
36. 977 977
978 ,979 981
- 984 MovieClip 988
MovieClip 988 MovieClip 991
TextField 994 996 998
1003 1003
1003 1007 Track as Menu Item 1008 ActionScript 1009
, 1012 LoadVars 1012 XML 1015
1016 1017
37. Flash- 1018 1018
Flash- 1018 Flash- 1021
1021 1023
Flash- 1028 1028
Flash- JPEG 1028 1029, LoadVars XML 1030
Flash- 1031 1037 1043
1044 1047
1050 1051
38, 1052 1053
1053 1053
27
1054 1054
1056 1056
1056 1057 1058 1058
1059 1059 1060 1060
] 063 1063 1065 1066 106S ] 071 1071
1071 107) 1071
1072 1075
setMaskQ 1075 1076 1076 1076
1076 1084
39. : Flash- 1085 1085 i 086
TexiField 1086 ComboBox RadioButlon 1086 ListBox 1087 CheckBox 1087 1087 108 7
1088 1088 LoadVars XML 1090
1092 1092Flash- 1092
1094 1095 1096 1098 1100 1102
1103
28
1103 1104
1105XML- travelCities.xml 1106 Flash- 1106
1110
40. Flash Remoting 1112 Flash Remoting 1112
1113 Flash Remoting 1113
Flash ActionScript Flash Remoting 1114 1114
NetConnection 1114 NetServices 1115
1115 NetConnection - 1116 1116 1117
ColdFusion Flash Remoting 1120 ColdFusion Flash Remoting 1121
ColdFusion 1121 ColdFusion 1122 ColdFusion 1123
ColdFusion Flash Remoting 1124 CFC 1124 CFC 1125 CFC 1126 CFC Flash- 1126 ColdFusion 1128
JRun Flash Remoting 1128 JavaBeans Flash Remoting 1129
JavaBean 1129 Flash-
EJB Flash Remoting 1130 EJB 1130 Flash- 1132
ActionScript 1134 RecordSet 1134 1134 RecordSet 1137 RecordSet 1140 RecordSet 1140 1141
RecordSet 1143 RecordSet 1144
ActionScript 1145 1146 HTTP 1147
.NET Flash Remoting 1148 ASP.NET Flash Remoting 1148
29
ActionScript ASP.NET FlashRemoting 1149 ASP.NET Flash Reraoting 1149
ASP.NET 1149 Flash- 1150
1151
41. 1152 Flash 1152 1154 XML 1155
XML 1155 XML 1156
1157 1157 1158 1158 1158
1159 1159 1159 1159 1160
1161 1 1161 2 1165
1167 3 1168 4 1175
1176 1178
1180 1183
1185 1187
1190 1191
1199 1200 1200
1200 ? 1201 1204XML- 1204 1205 1205
VII. 1207
42. 1208 Flash MX 1208
1209 1209 Flash 1210
30
1210 , 1211
1212 1212 1212
1213 , 1213 1214
evalQ Flash MX 1214 1215 1216 1216 Var- TextField 1217 1218 1219 1220 1220 1221 1221
, 1221 1222
1223 1223
1223Netscape JavaScript 1224
1224 1224, 1224, 1225
, ? 1225 Flash? 1225
1226 1226
1227 1227
1227 1228
1228 Bandwidth Profiler 1228
1229 1229
1229 traceQ 1229
ActionScript 1230 1230
ActionScript 1230 1230
1230 1231
1231 1233
31
43. ActionScript 1234
1235 traceQ 1235 1237 1238
123 8 1239
1239 1239
1239 1240 1240
1241 / 1241
Properties 1241 Variables 1242 Locals 1242 Watch 1242
1243 1243
1244 1245
1247
VIII. 1249
. - 1250 1250 - 1251
FLA- 1251 Flash Remoting 1251
1251Macromedia Flash MX 1251Dreamweaver MX 1251ColdFisionMX 1252Director Shockwave Studio 1252Homesite 1252JRun 1252BBEdit Bare Bones Software, Inc. 1252Xadra Fortress JRUN 1252
1253
. 1254 1254
{Robert Rcinhardt) 1254 (Joey Lott) 1254
1254 (Ian Chia) 1254 (Jen deHaan) 1255 (Shane Elliot) 1255 (Brian Lesser) 1255 (Kim Markegard) 1256
1257
32
1998 , Flash, -
, -. IDG Books Flash 4 Bible. ... . , (Robert Reinhardt) (Snow Dowd) - -. 1999 - . - the MAKERS () ( www.TheMakers.com). , , Web- Gossip ( Warner Brothers, 2000 ) , - Tonic. the MAKERS the Pledge ( Warner Brothers, 2001 ), Outlaw Productions. Flash- (www.trainingday.net) Training day ( Warner Bros. 2001 ). , , theMAKERS , Teachers Documentary Project (Web- www. pbs . org/f irstyear).
( ) () --, . , , . , Gossip.
, - the MAKERS, - Web- Rampt. com. - Flash-, , 1999 . , - " " (Macromedia Site of the Day) - '', Flash!" (FlashForward) -, Bandies 2000 " ", New Media Invision Awards 2000.
the MAKERS - Web-. , , Flash. Flash, - (Lynda.com, Art Center College of Design .). , - . FlashForward 2000-2002 , - Flash, (FlashintheCan 2002). Web- S1GGRAPH 2002.
" ", 1998 (Joey Lott) -. ClearDigJtal Inc, Web-. , . ClearDigital. Real Networks/Macromedia RealFlash - . Flash, ClearDigital - . - , , - , Flash. Flash , , ( - ColdFusion), - Sony, Disney, Warner Brothers.
2000 RightSpring, Inc. ( Beatscape, Inc.). - , Internet. RightSpring , , , . , Internet-, , - .
. - , , YourMobile.com - , . . , Web- Adsavant.com J2EE ( Java) Ads.com, .
, Web-, - . Lynda.com, -. , Internet, ActionScript. , .
(Simon Allardice) Web-, -
. 17- , - , -. - - , , , -. , C++, Java .NET. , - Foundation Imaging, , -
34
Emmy, (Arisona State University's Institute forStudies in the Arts), Web- Flashforward, , - -.
Building Web Applications with Dreamweaver MX, O'Reilly & Associates. - - Learning UltraDev, Web-Lynda.com.
Flash Dreamweaver (Ojai Digital Arts Center) - (Stanford University'sNew Media Academy). Macromedia UCON 2001, FlashForward2001, - , - Computer Graphics World Wall Street Journal Online.
, Web-, SIGGRAPH 2002, , .
www.clingfish.com. , , - Web-, .
(Ian Chia), (Jen de-
Haan), (Shane Elliott), (Brian Lesser) (Kim Markegard)
. Web- , , .
35
. Flash ActionScript .
.
, . , .
.
Web- Mac-romedia Flash. Web-, , Flash - . Flash- Web-, : , , , -, . -, , - .
Flash Web , , - . , , Macromedia Flash. -, , .
Flash - . . Flash 3 , leiltargei ( ). Telltarget Flash- - . - , -, . - .
ActionScript - "" Flash -
, Flash, Flash Player. Flash - Web-. - , Flash.
: -, ? Flash 4, -.
. - - , -? Macromedia , -
37
. Macromedia Director - Lingo. - . , " ". " ". - " ", - .
Flash . (Gary Grossman) , Flash 4. - . ActionScript , . , Action-Script , - . - , .
Flash 5. ActionScript - " " , , -
ActionScript. . Web- . - ActionScript. , ActionScript. Flash-, 10000 .
Fash 4, , . , , , -.
"" -. , Internet- JavaScript. ActonScript , JavaScript, ECMAscript. , . - XML. " " - Web-, XMLSockets. , - . - , .. Smart Clips, .
38
Flash MX. ActionScript - " " Flash . "" -
, - , - Web. , - Flash Player .
" ", Flash: " Flash, - 100 ". Flash Player, 400 .
Flash , Flash-. .
Flash MX , Dreamweaver.
Flash- , , . Flash , , ActionScript, , - .
ActionScript . - .
. Flash , . , " ". (Robert Reinhardt) - -. Flash 5 - , Flash 5. - . Macromedia Flash MX ActionScript Flash ActionScript, , - .
39
1997 Macromedia FutureSpIash FutureWave. , Web. Macromedia Flash, . Flash Player ; Ffash Web-, Flash - .
" " Web , Macromedia MX Studio - . - - . . Flash MX Flash. Flash 5 " '", Flash MX. , Flash 4, - Flash MX, - .
Flash - Flash-. Flash- Flash Remoting - URL- XML. Flash- , Web . JPEG, - Web-, - . Flash - . , Flash MX - , , ActionScript , , , .
Flash MX Macromedia MX, - - . Flash , Flash- (.. . swf). , ) Flash , -, , Web .
40
. Flash ActionScript. - , Flash MX (Flash MXBible) ( Wiley). Flash MX Flash-, Flash-, Macromedia Flash MX ActionScript (Macromedia Flash MX ActionScript Bible) ActionScript, - - , .
ActionScript. , Flash MX ActionScript, , . Flash- , - Flash-. ActionScript Flash MX, MovieC lip LocalConnection.
ActionScript Flash-. - Flash- Web-, , , . - ActionScript, - Flash-, .
. , , - . - Flash MX.
- Flash-( . f la), ActionScript, , . , - Flash MX - Macromedia MX Studio, Flash-, .
Web-, . , - , , Web-, Macromedia Flash MXActionScript no : www. actionscriptbible. com.
Web- , , - . , - . , www.flashsupport.com , .
,
.
41
-, , - , , . , - Flash : Window Panel Sets => DefaultLayout.
-, , . , , , . , . , , , - Flash.
,
, , , - ( ), - .
Cowr
1!
- . - .
, - , .
. - Flash .
, - , .
Flash MX Flash.
, - - .
, , () Internet .
42
, , , , . , . Flash-, - Actions.
, Flash MX,
Flash MX> , Flash MX , Flash- , . , . , ActionScript I , IV. , Flash-, - VII ' .
I Flash Flash MX
( 1), , Flash- Web( 2), Flash- - ( 3).
II ActionScript,
Flash MX. , . , -, , ActionScript. . , , - , .
III ActionScript
. - ActionScript, , , . - ActionScript, MovieClip LocalConnection. (
43
IV Flash MX , ,
. - , ( Component Flash MX), - Flash-. - Flash MX , , .
V ActionScript Web-.
Flash- : , Flash Asset Xtra Pocket PC. , , Flash- , Flash- - .
VIFlash- , -
. Flash , . - , Flash MX ActionScript -, , FlashRemoting Macromedia ColdFusion MX Server. -, Flash- ( ) - Java.
VII ,
Flash-. , Debugger Flash MX.
-
-, .
44
Web-, , :
www.actionscriptbible.com. , . , - , - , , - : www. f lashsupport. com.
- . : rpbertStheMakers .com [email protected] .com.
, , - , .
Macromedia Flash , , -
. , , - . , Macromedia .
Macromedia - (Feature Request) Flash. - - , Macromedia. : www.macromed.ia. com/software/flash/contact/wishlist
, - , - , Macromedia.
Flash Macromedia - , Flash - . - : www.macromedia.com/locator
, Flash Macromedia : http: / /webf orums.macromedia. corn/flash
, Macromedia MX Web- Macromedia : http: //www. macromedia, coin/desdev
Web- -, : http: //www.macromedia.com/showcase
45
John Wiley & Sons
Hungry Minds ( IDG Books Worldwide) - . - Tana (Chandani Thapa) - , . (NancySixsmith) , - , . (RosemaryGraham) , , , , - , , (Carol Sheehan) . .
(David Fugate) WatersideProductions " Flash", , , . . , , .
, Macromedia. , Macromedia, (Jeremy Clark), (Gary Grossman), (PeterSantangeli) (Erica Norton), Flash MX. (JenipherTchejeyan) (Henriette Cohn) . , Flash MX.
, , . ( ) - . (Simon Allardice) (Aran Bhalla). , , , .
(Jen deHaan), , , .
, -. - (Sandra Corsaro) ([email protected]) (Dwayne Quimby) ([email protected]) - , , ([email protected]), Perl, - , (Pavils Jurjans) ([email protected]), RegExp, - 25, .
, . . , , .
46
Flash MX
... 1 Rash
2 ' Web-
3 Rash-1
... Hash MX
Rash MX
Flash MX
Rash
Flash MX.
so Flash
Flash MX
Macromedia Flash MX -
, - Web. , - Flash. - - , . , Flash MX , - . , - Macromedia Hash MX.
Flash MX Flash MX
, , - Flash MX -, Flash. - - ( , Toon Boom Studio Swift 3D), , - , - Macromedia Director , - Macromedia. Flash Player - , XML - . Flash -
. , , Web- .
Flash MX , - Web ( ), . : . , Flash- - . Flash MX - - () ActionScript, - "" Flash 4 - . - , . - Flash MX . Flash, , Flash MX, .
Flash MX , Macromedia Flash
, -, , . Flash FutureSplash, . . - Flash, . , Flash MX.
. . -
. , . , , . , - , , , , Web .
. Flash . - , "" . , . , ( ) "-". Flash JPEG, - .
1. Flash MX 49
. Flash , - . Flash , - , Action Script. , Flash- Flash Player.
. , Flash MX . , Flash MX - . , Rash , . - . - ActionScript.
. Flash - . , , , , .
, Flash MX, Web- Macromedia : http://www.macromedia./showcase.
Flash MX Flash MX , -
Web-. , - Flash, , -, - . , Flash MX . .
. , , .
(timeline) Flash MX
Flash 4 Flash 5. Macromedia , , . Flash 5, GeneralPreferences ( ).
50 I. Flash MX
Actions Actions ().
, . - , , , - Reference (). , Actions Expert ( ). ActionScript.
ActionScript , , , ActionScript
, , , , Flash-. ActionScript . - ActionScript -. Flash . , Web- URL-, . , ActionScript .
, - , - . Flash , , : , , Flash , , - . Flash, . , , JavaScript, - ActionScript.
ActionScript System, LoadVars Stage
. , - TextField Button, .
Flash MX SharedObjects, cookie- , . - ( -) ( ).
Macromedia Communications Server MX, Macromedia.
- - ActionScript,
Flash-. ActionScript
1. Flash MX 51
Flash MX, , - , - - Listener, , , .
Listener 16.
Flash Flash MX . , -
ActionScript ( . ssas), . ActionScript - Macromedia ColdFusion MX Server, , Flash-. Macromedia Macromedia Communications Server MX, - , Web- -! Web- .
,
Flash MX. (Smart Clips) Movie Clip(), Flash 5 - , , - . Flash MX , , Macromedia Exchange. Web-:www.macromedia.com/exchange.
Flash Player Flash Player 6
"" MSAA - XML. , - Flash-, , , XML- - , Flash Player 5.
Unicode Unicode 16- ,
. Unicode, 1991 . Flash- Flash5 . Flash Player 6, . , Flash MX, - Unicode UTF-8. Flash Player UTF-8 UTF-16, Unicode. , Flash Player 6, Unicode -
52 I. Flash MX
, , - , Flash MX.
system.codepage1*;\ 17.
, Flash Player -
( , ), , Web- . W3C Web- , - Flash Player 6. , Flash Player 6 Mi-crosoft Active Accessibility (MSAA), - , Flash MX Web-.
-
Flash 3, 4 .5, , , , Macromedia Generator, . - Flash Player 6, Web-,
Macromedia , -
Flash MX - . - , Web- . Macromedia - Flash MX.
Macromedia , Flash MX , . - , Flash MX. , - Flash MX.
Rash MX (
FLA), , Nokia 9200 Pocket PC, ,- . - -
1. Flash MX 53
. - , - .
Flash- HTML-
, Back () Web- Flash 5 - ActionScript JavaScript. Back ( Flash ) , Flash 6. , - , ActionScript JavaScript.
Flash MX. , - , , . - Flash- . , Flash- . , , .
, , 37.
-
, , LoadVars - XML Flash MX . PublishSettings ( ) .
/
Flash 6, ActionScript, -;1 ,
Publish Settings.
Flash, Flash MX, -
Flash, . -
54 I. Flash MX
Flash, .
: , - . ( ) - . , , , - .
: Flash- , , . , . , ,
: , - (.. ). - , , -.
: , - . . , . ( ) ( , ). , .
ActionScript -, , - . ActionScript - , , .
Flash- . -
Flash- Flash Player ActiveX, Web-. Flash- , Flash- HTML. , Flash Player, (projector). Flash Player , - Web- . -, - DVD-. Flash- QuickTime (MOV) Video for Windows (AVI), Flash MX . , Flash- (.. FLA) - . , Flash, .
1. Flash MX 55
, Flash MX Flash MX -
Flash- ( . f la). Web Flash- ( , swf), "" Flash Player .
, Flash- . , . , -, , , . Flash-, , - , Web. ( SWF), , - . - , - SWF , . - . ZIP SIT, . Flash MX - Publish Settings, File => Publish Settings ( "=> ).
Flash- 3. '
Flash Flash MX
. - Flash-, , , - . , -. , , , Macromedia - ColdFusion - . XML Flash, Flash Player, XML .
Flash , Macromedia Generator ( ) . , ( ). - , .
56 I. Flash MX
- " Flash MX" .
Flash MX Flash , -
Flash MX - , , - . Flash -, , . - . , Flash MX.
, - .
- .
, .
-, - .
, Web-. .
-, XML - .
, - , Flash
Player 6.
, .
, - , Flash MX.
, MicrosoftPowerPoint, - .
" ", - .
, .
, .
Flash-, - , .
, . - .
1. Flash MX 57
Flash , -
, Flash . Flash 5 MX . Flash, , , - . Flash MX , , -, . - , , - , , - Flash MX .
- . , . -, XML CFML ( ColdFusion Markup Lan-guage), , Flash? ,, ? ( ) ? - ?
, - Action Script, , , . , , , LoadVariables ( ) , LoadVars Flash , URL. , - ActionScript.
Flash-, -, , , , . 1.1 - , - .
- , , . . , , . - .
- - 3.
58 I. Flash MX
, j
( ) (
i
. 1.1. - Flash-
Macromedia Flash MX -, . - Flash - Web-.
Flash- Web. , , , -, -.
Flash MX . - , .
ActionScript Rash MX - - , .
1. Flash MX 59
. Bash Web
, .Rash :
1, Rash
Rash
Web-
Flash- ,
ActionScript, , , Flash- - Web. , , Flash - Web.
Flash Web
, , - Web. Web? - Web- ? , Flash - , Web.
Web Web- -
. , - Web ( ) , , - , Web-. , , , Internet. , - .
, Macromedia Flash, Web- . , 1997 Flash 2 - , , GIF. 1998 Flash 3 - Flash- , , - .
1998 Macromedia Generator, Flash, GIF JPEG. , Generator Flash- ( ). - , Rash - Web-, - Web-. Flash 4 1999 - , - . Flash- Web-, , (.. ) Generator. Flash- , , , . , - Flash- ActionScript, -, "", .. , Flash. - , , FlashActionScript Tool (FAST), SwiffTools Win-dows- Flash.
/
Macromedia Generator . Generator ( Flash-,
FLA) Flash MX . -, Flash 5.
Macromedia 2000 Flash 5 , XML-. - , ActionScript - - (), JavaScript.
Web- Rash MX. , , - XML-, , - . - Generator. - FLA. a Flash-, , Web-. ActionScript Flash 5, , ''" , - .
2. Web- 61
, (.. , - ) Rash , Web. 2000 Flash , -, Web-. - Rash- Web-. "" Flash, . - , Rash, (Jacob Nielsen), , - . 2002 Macromedia - Rash . , Internet- , Web- , Flash. ? Rash Web - , - ? , Flash -, - . , - . , Rash Player - 400 Windows-, Rash Web .
Flash Player 2001 , Flash Player 98.3%
Web. , , -. . 2.1 - Rash Player ( , ).
5 2.1, Flash Plaj
Flash Player 2
Flash Player 3
Flash Player 4
Flash Player 5
98.3%
97,8%
95,1%
86.2%
98.6%
98.4%
97.1%
88.7%
97.1%
96.7%
94.6%
88.2%
97.6%
95.4%
93.4%
86.5%
, -. , Flash Player , , Web, -. Nokia -, Rash Player . 2002 -, Rash Player 7 (. 2.2).
62 I. Flash MX
2,2. Rash Player
Windows
MacintoshPocket PCOS/2
Sun SolarisLinux
SCI IRIX
Flash Player 6
Flash Player 6
Flash Player 4
Flash Player 4
Rash Player 5
Flash Player 5Flash Player 4
95, 98, 2000, ME, NT, XP
OS X, Power PC
Casio Cassiopiea, Compaq iPaq,
Spare
X86
HP Jornada
Flash Player Web- Macromedia : www.macromedia.com/software/player_census/.
Flash Flash -
Web-, , Flash. , Flash -. , , Flash, - . , Flash , ,
Flash? Flash.
. , Disney Warner Brothers, Flash . Flash- - ( ).
. , Flash- - (GIF, JPEG, PNG, PCT, TIFF), ( - FreeHand, Illustrator, EPS) (WAV, AIF, ). Flash Player - . , Macromedia FreeHand Fireworks ( , ) Flash. - Flash-.
2, Web- 63
. , - HTML- , , Hash- , Flash Player.
, . Flash- (.. - ) , - , Web.
. Rash- Web-. Web- HTML, Flash, - - , Flash - , - ( Flash Player, ..).
, .. - . Flash-, "", - . Flash 5 XML- . - Flash MX.
Flash- . , - Flash-, Flash-. Flash- - Web- - , , Rash , , Web-.
ActionScripi ( Flash MX ). Generator - .
. , (.. , ) - . , Flash MX , - Flash-, . - , - .
. -, Flash Player Windows, Macintosh, Linux, Solaris, OS/2,SGI IRIX Pocket PC. Flash- - ! Flash- ( , Windows Macintosh), .
64 /. Flash MX
, -. Flash- , - Web-! , Flash- -, DVD- .
. Flash- ( ). , Hash- .
. Flash Player 6 MSAA Flash MX -. , - , 508 .
Flash -, , 30.
. Rash MX - Sorenson Spark, , . - , - .
. - Macromedia Communications Server MX Hash Palyer 6, Flash-, -. , Flash Palyer 6 Web- - , -, .
, Flash-. Hash , ! , Rash .
Flash Flash -
Web-, , Hash .
Flash- ( ) . - .
- Hash-. , Web- -- Flash-, - . , InternetExplorer Macintosh Hash- JavaScript f scornmand. , , -
2. Web- 65
, Internet Explorer 4+ Windows Netscape 3.x 4.x ( Windows, Macintosh), Flash Player 6.
Web- , Flash Player. Flash Player . , Macromedia - Flash Development Kit, Flash- Web-. 29. Flash MX -, ( , QuickTime), . , Flash- - .
Flash- . Flash . - ActionScript, - - Macromedia Director 8.5.
Web ( "") Flash-. Web- Flash, Web- - ( ) HTML. Flash, - .
, MSAA Flash Player 6 - , , Web-, - MSAA Flash Player.
Flash- HTML . - , Flash. Web Flash-, , , , - HTML.
Flash -, , - HTML- GIF/JPEG - . , HTML- .
, , , , Flash. - Flash- .
66 I. Flash MX
Flash ( )
. . - , , Flash .
DHTMLDHTML ( HTML) ,
(DOM), 4.0 . , - Web: Notepad Simple Text MacromediaDreamweaver. Flash- DHTML - Flash- HTML-. DHTML - , Internet Explorer Netscape . , ( ).
XML XSLXML (extensible Markup Language), HTML.
, , - , , , , . A XSL (extensible Stylesheet Language). XSL- , - XML- . XML- XSL- Web-, . . - Web- ( ) - Flash Player. , , Flash Player Netscape4,0, , Flash MX, XML Internet Explorer 5. ,XML .
SVGSVG (Scalable Vector Graphics), -
, Microsoft Adobe. (World Wide Web Consortium - W3C) SVG Web, SVG , Web-, XML. Adobe SVG, ( , Adobe Illustrator GoLive) - . , Adobe SVG. W3C Web , SVG - , -. SVG Web , .
2, Web- 67
SVG Web- Web- Adobe : www. adobe. com/ s vg W3C:w3c.org/Graphics/SVG.
Macromedia Shockwave Director Macromedia -
Director, . - 80- XX Director -, . Director , , Flash-. , Director - Xtras, - Director. Director 8.5 . Shockwave ! , ShockwaveDirector : , , Windows Macintosh. Director , - DVD-.
SMIL, RealPlayer QuickTimeSMIL (Synchronized Multimedia
/ntegration Language), HTML. S MIL- , RealPlayer Real Systems QuickTime Apple. , - SMIL RealPlayer, - , . SMIL . SMIL -, , Flash- - "", SMTL! ,Flash- "" QuickTime SMIL. Flash 4 Macromedia Apple Flash- QuickTime, Flash-, . RealPlayer - "'" Flash- SMTL. . , "", , - .
Macromedia Authorware Flash, Authorware ,
Macromedia, - Authorware. , , , , Director,
68 I. Flash MX
Authorware - . , - . Authorware - Flash, - Bash Web-, .
Microsoft PowerPoint , ,
PowerPoint. PowerPoint , , , PowerPoint Viewer. Flash - , , - Pocket PC FlashPlayer.
, Flash Web, -
, Flash. ActionScript Flash-, Flash- , Web- ( ) Web .
HTML - , HTML
Web-. HTML , , - , . , Flash, HTML. HTML.
Flash- Web-. , - HTML- Active X, Internet Explorer, , Netscape, - .
Flash- . Flash , Web, - , Flash- .
HTML- Flash- , ( ) Flash Player. - Flash Player , . HTML-, , Web-.
2. Web- 69
, . , - QuickTime Flash-, HTML-. PDF , , Flash-.
HTML- Flash. , , , - , HTML. HTML , , , - , Flash-.
, HTML- -, , HTML. HTML, Macromedia Dreamweaver.
JavaScript ActionScript JavaScript, ,
, , , JavaScript HTML-. JavaScript, - ActionScript, , ActionScript. , JavaScript HTML, aActionScript Flash. JavaScript Flash?
JavaScript Flash- Web-, . , Flash- - ( , ). JavaScript Flash- , ( ) JavaScript Flash- - .
JavaScript , Flash-. "" - , , .
JavaScript Flash-, , . JavaScript -, .
, , JavaScript ( ) Flash Player. JavaScript ( -) Flash Player. , VBScript Internet Explorer ( Windows) - Active X Flash Player.
70 I. Flash MX
"JavaScript. " -, , 2002 .
Flash
Flash-, . , Flash- ( SWF), , Flash- Web-, -. Flash-, - , , .
, ,
: ( . txt) Web- ? , , (static). , , , (dynamic).
, , -? ? .
1. : - ( , )?
2. : ? , 10 1000 ?
3. : - ? Web- ?
, , , , Flash- - . , , , Flash-, . , - ( , Flash-), Web- Flash- Web-. , Flash-, - Web, .
1. : ( , Oracle, Microsoft Access,FileMaker ..) , Macromedia ColdFusion, , Flash-. , . - , . 2.1.
2. Web- 71
Web-
Web-cepeep
(.Access. Oracle
. 2.1. ,
2. : , - -. -, , Flash-. , , 100 -, Flash- , - , , Flash-. (.. ) , , Web-, . 2.2.
3. : , Flash-. , . . 2.3, Web-, ,, .
, - Flash-.
72 I. Flash MX
IH
Web-
Web-
. 2.2. , ,
Web-
Web-
I
. 2.3. , ,
"-" , Flash-
, "-" URL- . ? "-". -, :" ". - , - . , () . greeting (). ( , .) (value) - " ", greeting= .
2. Web- 73
"-", (=). URL Web- , - . , - : . , - Flash-. - URL, , :
greet1=%20%20%20%20%2
: %20 , %2 . , ( ), , - , - . , . Macromedia ColdFusion, - Microsoft Access Flash-.
Flash- - , 39 40.
XML XML-.
Flash Player 5, Flash- (.. ) XML-. - "-" XML :
flo6po .
HTML, ? , XML-, - . , . . . , , . , - XML- . XML- :
, XML- , . - : . XML- Flash - . , XML Rash ActionScript, " ", XML.
XML 23 24, XML " - XML 21 ", , 2000 .
, , Flash-. , . - Flash- . , .
-
, Flash. , - Flash. - , , Flash.
Internet- -
, Flash. , . Flash- - Flash Player , Web- , , . - , . ActionScript . , - Flash, , Flash- - Web.
. -
, -
2. Web- 75
. Web-, Flash HTML. Flash- , , - , . , - Web- , Web- . , - Web-, Flash-.
Flash ,
( ) , , - . , , Web- Flash-, , - Web-. . - Flash- - Flash-. , Flash-, , .
Flash-, -
Rash- . , , Flash- . - Flash- -. Hash- , Web- , - . - Flash-.
Flash -
Web-. Web-, , .
Flash , , , Web-.
Flash -. Flash- Flash Player, . . , Flash- .
76 I. Flash MX
, Web. , - , - - . , Flash , .Flash- , - . , , .
2. /- 77
...
. Bash- :-, -
.
Flash-
, Flash : -
. Flash - . Flash- , , - Flash- .
Flash-
- ActionScript, , - . ? ? Flash- , -, ? - Flash-:
Flash-;
Flash-;
, Flash-;
.
, - , , . , , , - " Flash-" " ".
, - .
2001 Macromedia Web-- Sitespring. , , , Web-. , Sitespring , - . , Sitespring Web-, Flash-.
, , , , - Flash . Web- Flash. - , -, Web- .
(Monique Daley), (Anthony Amidei) (BenOldham). Sitespring. Web-(Discovering Sitespring: A Practical Guide to Web Site Project Management), Wiley.
. (Nucholas V. luppa). Web (Interactive Design for New Media and the Web), Focal Press.
(Steve MacConnell). (Software Project Survival Guide), Microsoft Press.
(Ashley Friedman). Web-. Web- (Web Project Management: Delivering Successful CommercialWeb Sites), Morgan Kaufmann Publishers.
Web- , "management" Web- [theMAKERS] resourceBase:www.theMakers.com/resources.
Flash- -
. , - -.
, ,
, . , Flash-. - , . .
3. Flash- 79
(.. - )?
? ^ ,
-? ?
? - (, , ); ..?
, ? ?
? - ?
? , , - ? ?
? ? ?
? ? - ? - ?
. . , . - , .
. , , , . , , . , - Rash-, , . , - , , , - . , - ? , .
" ",
. - . -
80 I. Flash MX
, , ( ) - Flash- ,
? - . *
? , (1.0), - ?
( ) ? , 10 ( ) ( -, " ")?
? -, , , -, . , - Search for: (), Proceed (). , {, Flash, - HTML, JPEG ..).
? -? , , .
? - , .
, . - , . - . . - .
- : www.mojofat.com/tutorial/index.html. - PDF.
- -,
. - - . . -, , , , .
, - : (organizational) (process). - -, ( ) .
3. Flash- 81
, - . 3,1. - Web-, - Web-, - .
. 3.1. -
- , - , , - (, ). - , - , . 3.2.
- -, . , - - : Microsoft Visio - SmartDraw. Visio 2002 - -, , . , .., - -. - . -, - . - , - -.
82 I. Flash MX
. 3.2. -
, , - . , - , . , -, . , (RogerGannt). - , Microsoft Project Microsoft Excel. - , Web ;http: //associate.com/gannt/. , , - , . - " " (Designing Interactive Digital Media), Focal Press.
, Flash- 83
Flash-, Flash,
, Flash, , Flash-, "" , : Flash- , Web-, Flash ?
Flash ; HTML-
Flash Web- , Shockwave Director, Apple QuickTime Windows Media, - () , , HTML-. Flash- ( SWF) HTML-, , , , . , - Flash- ( ), HTML-, , - Web-, Hash-, - HTML-, , MacromediaFireworks Dreamweaver. . 3.3.
HTML-
Flash-(
.SWF)
>-
HTML-
Flash-(
.SWF)
*i
1 HTML-
Flash-(
.SWF)
. 3.3. Flash-, HTML- Web-
Flash- , ( ) - HTML, , , Bash- SWF.
Flash : HTML-
Flash-, Flash, , .
84 I, Flash MX
Web-, HTML , , .
, ( JPEG, GIF PNG), ( WAV, ) HTML-.
Web- ActionScript HTML (DHTML) JavaScript. , Web-, Flash, JavaScript Flash.
, - .
, Flash , , Flash-. Fash , Flash Player, a Web- Flash-, , SWF. Web-, Flash , . 3.4.
HTML-
Flash-(SWF-)
Flash-(SWF-)
Flash-(SWF-)
. 3.4. Flash- Web-, - Flash
Web- Flash
Flash Web- SWF. , Flash MX Flash Player 6 - . JPEG Flash-
3. Flash- 85
. , JPEG, Flash- , Macromedia Generator.
Flash MX Flash- ( SWF).
Flash- Web- -
( , Apple QuickTime, Win-dows Media RealPalyer), Flash Player. Flash-Web-. JavaScript .
DHTML Flash, . , ,
, HTML- , , Flash. - .
Web- Flash - , QuickTime RealPalyer. Flash-. " " (Unwrapped: The Mysterious World ofMummies) Web- TLC : http://www.discovery.com/highspeed/tlc/mummies.
RealPalyer Flash-, - JavaScript DHTML , , Flash-. Flash- - RealPalyer JavaScript ActionScript f s command.
. , - JavaScript ActionScript InternetExplorer Macintosh. Web- -, Web-.
Flash
. , Flash- SWF, .
86 I. Flash MX
Flash, , ,
. , Flash-.
URL: URL , , getURL () , loadMovie (),loadvariatales ( ) LoadVars. URL , :serverPath = "http://search.mydomain.com";
: Flash- X Y MovieClip . - Flash-.
: Flash- . , SWF, Web- Assets, assetPath, . , , , assetPath.
: , , - Flash-, , - .
: ActionScript - SWF. Rash Player - ActionScript , .
I Macromedia ColdFusion MX
ActionScript. . ColdFusion . ssas.
ActionScript , ( ) " ".
5.
Flash- . -
, , - MovieClip, . . MovieClip functions , , conf ig , - .
3. Flash- 87
function 6.
Flash 5, ,
Objects. , Flash. Objects ActionScript , , .
-^ objects ActionScript 7.
, Flash-
, . Flash-, .
SWF SWF. -
loadMovie ( ) , - . , - Flash-, . SWF.
-: SWF, JPEG ., - . , , -.
: Flash 5, Flash Player - , SWF, , , , - SWF, Flash- Web-. Flash MX - , , , . , Flash MX, . - , Flash-. .
88 I. Flash MX
, : Flash Player . , - . SWF , , , XML- Flash Player 6 . , .
, , Flash. , . - , ,
37.
, Flash Player,
, , MS NotePad, WordPad, Word BBEdit ( Macintosh). , URL- "-" XML. , , Flash-. FLA , , SWF. - , Flash.
, . URL: URL, Flash-,
Flash-.
: - SWF, ( , SWF), - .
Flash: , Flash, HTML, . , , .
.as ActionScrlpt. Flash Player, - SWF Flash-. . as 6.
3. Flash- 89
, - , , - . , - : Oracle MS Access FileMakerPro. , , Flash- Web-, , . - , CFML(ColdFusion Markup Language, ColdFusion), ASP(Active Server Pages, ), Perl/CGI. - . - : ColdFusion Server, IIS ( APS), PHP Applica-tion Server .
- Flash- Flash-, Web-. , , - .
. -
, Utitledl. f la,Utitled2 . f la, Moviel. f la .., .
Flash- - , -
Flash- , . . 3.1, - Web-, Flash.
/
, Macintosh, - Flash- .fla
Windows.
,
Flash- Flash-. .
90 I. Flash MX
- Flash. ActionScript . Flash- , , 8 , - ( ). . 3.1,
menu, main_menu, menu_l, menu_2
mainMenu, menuChoice_l, menuChoice_mc
invisibleButton,logoGraphic
bgSound, emptyMC, sound_l
isLoaded, firstName, lastName
createMenu(), changeColor(}
mouseColor, souncl_l, soundFull
speed,currentPosition, currentPos
Script () Actions() . - , , 4.
Flash.
: (_) . , , , Imenu, ActionScript,
: , - . , .
: , . - (, box_l, box_2, box_3 ..)
: , , ,, i . . , . , , , - . , , . - .
3. Flash- 91
.Web- Flash, Macromedia : http: //www.macromedia.com/flash/ts/documents/naming_strategies.htm
" " (Coding BestPractices) : http: //download.macromedia, com/pub/downloads/actionscript_standards.pdf
Flash- .fla
. , , , Flash- _100 . f la -. , , . - 1, , 101, , 1 , , 200. , ,
Flash , - , . , - , - 10/100 Fast Ethernet. - .
, WebDAV VS. , CVS (Concurrent Version System, - ) , . CVS , . A WebDAV (Distributed Authoringand Versioning, ) W3C Internet HTTP. , ( ), , , , .
, ( -
, ) Flash-. - Flash, - Macromedia Fireworks Adobe Photoshop, - Flash-. - , ,
Flash- , Flash- ( -
. fla), , ( . swf), HTML . - , .
92 I. Flash MX
\
, ,
Flash-, WAV> PNG HTML. Web- ( - ). Web- SWF HTML. SWF , FLA (.. Flash-). , - , FLA ( ) SWF.
(assets), -, ; (sections), , ; (shared), , Flash 5 . Flash- ( main. swf) - dev. , _old. , , _fla, FLA. , Flash- ( - f la ) Fash- ( . swf) Flash- . - .
1. Publish Settings ( ) File =* Publish Settings.
2. Use default name ( ) Formats (. . :) Flash Filename, . 3.5. - SWF , - FLA. , , - Macintosh, Windows. -, . . / Windows, Macintosh.
3. Flash- ( . f la) _ f la Flash- File "=> Publish. SWF , _f la.
. . : . , , _1 , - : . . : . . : . . , : , , HTML-.
Control Test Movie. File ^> Publish. - loadMovie () , , , .
3. Flash- 93
PubfeH'Seit
E! Ra>h
E] HTML (.html)
GIF Image (.*]
[ZlJPEG Image (.jpg)
Q PNG Image [.png)
(l."| Windows P/ojectot |.exe)
D Macintosh projector
Q QuickTime (,mov)
. .5. Formats
Rash- Web-,
SWF , , HTML-. -, Macromedia Dreamweaver MX, CuteFTP ( Windows) Vicomsoft FTPClient ( Macintosh), , , , _f la _old. _prod , . 3.6.
logo.swf
jj maln.swf
EJ$ sections
products.*wf
'0 ihared
g| fonts,swf
. .6. ,
Site Cloaking Settings ( ^> =* ), - Site Files Macromedia
, Dreamweaver MX, .
94 I. Flash MX
, , - - .
"", , -, .
Rash- HTML- Web- -.
, , ActionScript, Flash- - SWF. ActionScript Flash Player. Macromedia ColdFusion ActionScript.
: SWF .
Flash- - .
, SWF HTML, , - .
3. Flash- 95
ActionScript
4 ActionScript.
5 ActionScript
6
7
8 ActionScript
9 ActionScript
. .'ActionScript
.'
Flash i AetionSciipt
'- frame, Button MovieClip
. .!Actions .
Actions
ActionScript.
, -
.1. .2. -
.3. , -
.
. ActionScript, . - ActionScript. - " " ActionScript Flash Actions..
/ '&&. ActionScript. -
*
.. 5.
ActionScript? ActionScript
JavaScript, Rash-. , , . - . , - , . - ActionScript. , Flash-.
"", "" " " . , .
ActionScript - , . - , . - . ,ActionScript , Flash-. . , . , -, JavaScript, ActionScript .
-262: - ?
, JavaScript, JavaScript ActionScript. , -262. -262 . JavaScript Netscape, LiveScript., , . - Microsoft JavaScript IE (Internet Explorer). , JScript. " -" , Internet-. JavaScript, Netscape Microsoft, . - (European Computer ManufacturersAssociation, ECMA) - -262. ActionScript -262, . Web- ECMA: http: / /www. ecma. ch,
ActionScript ActionScript, -
. , - , - . , . - Flash- . :s top() ; ,
, ActionScript , . ( ) stopO . - , ActionScript , . ActionScript - , , , . - ActionScript . .
4. ActionScript 99
Flash-, - . , , ActionScript.
ActionScript:
ActionScript , . Rash-, . , Flash , , , -, .
ActionsScript Flash .
. , , . , -. , . , . , - " ". - . () ( ) -. - (). -, , . . , . - , . - , . , .
Hash (time-based) (user-based). . , , . - , .
Flash , . , , , , . - , . ,, , , . . , . . 4.1 .
100 II. ActionScript
4.1.
on
, , Actions. . , , , Actions.
MovieClip Button , , , . , Button:
on(press){trace(" . " ) ;trace(", .) ;
}on(release){
trace(" . " ) ;trace (" "),-
, MovieClip:
onClipEvent(enterFrame){trace{"
."} ;}onClipEvent(data){
trace{" , .") ;}
. 4.1 .
- . . . . , : " ". -, , , - . .
, , - , . ( ), - . , , . , - . . 4.1 .
, , Movie Clip - , . . - Movie Clip . - ActionScript.
102 II. ActionScript
P-Layer! / *
. 4.1. : ; - ; , ; - ,
, ,
. , Flash-, , , , .
"" - on{mouse/keyboard event) ( ). -
, - MovieClip . , on (mouse/keyboard event), - , , . - - . , -.
MovieClip MovieClip . -
, - on (mouse/keyboard event). MovieClip onClipEvent, - . , on (mouse event). , , load, enterFrame, unload - MovieClip. mouseDown, mouseup mouseMove - . -
4. ActionScript. 103
on {mouse event) button , , , MovieClip. , onClipEvent keyDown keyUp, - . , - . , data - , , loadMovie loadVariables.
/
MovieClip, MovieClip.
, MovieClip, . MovieClip, onClipEvent ( ) , - ,
, MovieClip - onClipEvent, ,
i*dbt . ^* ,
Actions
, . , Hash ' - . , - ActionScript.
Flash 5 Ac-tionScript, , - . - . Flash MX . . , -, . - , - .
- . , MovieClip Button Flash - Actions. - Window => Actions ( => ), - . Actions , . Stages () Properties (). . / , - , .
. 4.2 , Actions Actions Frames ( ). , . MovieClip, -
104 II. ActionScript
Actions MovieClip ( MovieClip), - . 4.3. , Actions Button ( ) , Stage Button. Actions. , , , - MovieClip Button. - .
Actions -
. 4.2. Actions "ActionFrame". ,
Arlums Movie Clip
. 4.3. Actions "ActionMovieClip". MovieClip
Anli i int - Bullwi
. 4.4. Actions "Action-Button".
Actions . . 4.5. ScriptNavigator. , ( MovieClip, Button), - . , - . - (Actions Toolbox) (Script Pane,) .
QjjJ 0**i*0flQpjjl FuncTtonc
[jfj Cow I INI
PlOpWIi*
DiprtoiltdntshUCompo*
I1,'1
Puc. 4.5. Actions: Script Navigator, Actions Tools ScriptPane
4, ActionScript 105
Script Navigator Script Navigator ( Jump-)
Flash MX. , MovieClip, Button ( ), , . , MovieClip , - , Script Navigator - 1 Button. , 2, Script Navigator 2 MovieClip. . 4.6 4.7, . .
. 4.6. Script Navigator ,
. 4.7. Script Navigator , -
Script Navigator , "" . , , , Actions. - . ,"" , . "", , .
Actions Toolbox Actions Actions Toolbox
( ). ActionScript , , . Actions Toolbox , Actions, Operators, Functions .. - , , . - / .
Actions Toolbox. .
- Actions Toolbox | " Actions".
106 II. ActionScript
(Actions) , ( ) . , -, , Printing (). - .
Objects . Flash 5 . Flash MX Actions Toolbox Macromedia . -. , Methods (), Properties () Events (), .
- Actions Tools . , Actions Toolbox , , . - , . , , .
Actions, , (View Esc Shortcut Keys). Actions . .
Script Actions Script ( ).
ActionScript. , , . .
Flash, Flash 5, -
Flash . - , .. , Flash. , ActionScript. Actions, : Normal () Expert () (.. 4.8).
:
Actions, ;
View Options ( ), - Actions;
4. ActionScript. 107
. 4.8. - Actions
( (Macintosh) (Macintosh) Actions.
( Script) Flash Actions.
, . - . Actions . Reference (), Parameters(), Actions () Script ().
Script Actions Reference. , Actions ( ). Reference . . . .
Parameter (). . , , . (,trace) , , , .
Actions. - . , . "" - . , ,, , Actions Toolbox. "" . . Find () Replace () ( ) -
108 //. ActionScript
, Insert Target Path ( ) - , - Movie Clip. , - , 43. , , -. , () .
, Script , . " " - , Actions . Script :
Actions Toolbox ;
;
;
.
Script . , .
( )
Actions , Script Navigator Actions Toolbox -, Script . Reference Parameter. , , . .
Actions . , . - . - - . . .
, , . - .
Actions ,
. - Actions ( Preferences), ActionScript Editor preferences ( ActionScript) Preferences ( Edit =!> Preferences). . 4.9 , - ActionScript.
4, ActionScript. 109
. 4.9. . ActionScript
Flash . - , Flash :if (true) {
, (}), , ActionScript -, (Tab Size ( )), Tab Size 4. , .
Text () , Script.
" ".
, ActionScript Editor - . SyntaxColoring ( ) . , , . 6 .
Foreground ( ) , .
Background () .
Keywords ( ) , Actions>Conditions/Loops Actions Toolbox, function, delete,var, with, tfendinitclip, #include, #initclip.
Comments () .
Identifiers () , , , .
Strings () , .
, - .
110 II. ActionScript
ActionScript -
. , , . - . , .
Flash -. . (Auto Format) Actions. - - Actions. - . ocd- , , .
, , Auto Format Options ( ). Actions. . 4.10 - . () . - , .
lotmul Options
fF" '{'
. . Script ( ) Flash . . - (tooltip code hint) , (. , 4.11). (Menu codehint) (. . 4.12) , .
. 4.11. . 4.12. -
Script :
for(;
i f ( ;
switch (;
while(;
methodName {.
:
on(;
onClipEvent{;
objectName
. . -
Script. , :
, Actions;
Show Code Hint ( ) - Actions;
(Macintosh).
. , - (.) (;).
0 4 - ActionScript. .
112 II. ActionScript
, . - , Math, Flash , - Math. - ( , Action Script), , Flash , .
, , Date, today:
today * new D a t e O ;
;
today.
, Flash today Date. .
-, , Flash. . 4.2.
,
Array
Button
Camera
Color
Date
Microphone
MovieClip
NetConnection
NetStream
SharedObject
Sound
String
TextPield
TextPormat
Video
XML
XMLSocket
_array
_btn
camera
_color
_date
_jnic
_mc
onne t i on
_stream
_so
_sound
_str
_txt
_fmt
video
_xml
_xml socket
/
, Flash, . " Actions".
:
today __date = new D a t e O ;today_date .
4. ActionScript 113
, -, Date .
, . , - , :
// ClassName objectName;
Date Flash - :
// Date today;
today_date.
. , -
:// String strMyStringstrMyString = " ." ;strMyString
Reference Reference () FlashMX.
, ActionScript. Window => Reference ( ) - . , , - Actions Toolbox (. . 4.13), Actions. Actions , , . .
Availability () Flash, - .
Usage () .
Parameters () .
VwUblH
Corrfilicnt
Plimtag
Actions ; Actions that cen be added ttf yourscript _'_ii- --
Puc. 4.13. Reference
114 II. ActionScript
Returns ( ) , .
Description () .
Example () (working example). .
See also () , .
Reference (). - , . , Reference - .
.
1. ( 36, ( Macin-tosh)) Actions View Reference ( ).
2. ( Script) Actions Actions.
Actions Flash 5 Flash MX
Actions Toolbox. - " ". Macromedia - . XML- Actions Toolbox, - , - . , , Actions. - : " , ". ActionScript . . , , - .
, XML-, - .
Windows 98/ME: :\[ Windows]\Application Data\Macromedia\Flash MXXConfiguration\ActionsPanel.
Windows NT: :\[ Windows]\profiles\\ApplicationData\Macromedia\Flash MX\Configuration\ActionsPanel.
Windows 2000/XP: : \Documents and ^1\\Application Data\Macromedia\Plash MXNConfiguration\ActionsPanel.
Mac OS Classic (Mac OS 8.x ) : Hard Disk :System Folder : Application Support : Macromedia : Flash MX :Configuration : ActionsPanel.
4, ActionScript. 115
Mac OS Classic (Mac OS 8,x ) : Hard Disk :Users : : Documents : Macromedia : Flash MX :Configuration : ActionsPanel,Mac OS X: Hard 1/8//1/1.1:1Support/ Macromedia/Flash MX/Configuration/ActionsFanal.
23 XML- , XML-.
Actions Toolbox Macromedia - CuatomActions. 7,
ActionsPanel.xml ActionsPanel, xml Actions Toolbox, -
Actions . ( ), . , , . .
ActionsPanel. xml ActionsToolbox. XML-, CustomActions. - 7, , Actions Toolbox index. ( ) , - Actions Toolbox.
- , -
XML-.
Action Toolbox.:
name Action Toolbox;
sort , , . XML-(false), (true);
tip text , - Actions Toolbox;
helpid , - .
Action Toolbox. -
. .
116 II. ActionScript
:
name - , Actions Toolbox;
tiptext , - Actions Toolbox;
helpid , - ;
quickey . , , esc+sa guickey ;
text (text2, text3 ..) , , , - Actions Toolbox . text. text2, texts .. , . , - . , (%). Flash - . . -, :
Script :
_( !, 2 );
version - Flash-, . 4 - , Hash 4, 5 6. 6 , Flash 6.
Actions Toolbox ,
. , , ,, .
:
name - , Actions Toolbox;
tiptext , - Actions Toolbox;
helpid , ;
quickey . guicJcey .
text (text2, texts ..) . text .
version . version .
type - : procedure, event, listener.
object , , , . - .
4. ActionScript. 117
. , -
Actions Toolbox. .
. , ,
Actions Toolbox. .
mode normal () expert ().
ActionsPanel.xml XML-,
Hash. He . - , Flash . .
1. , Flash MX .
2. ActionsPanel, xml. .
3. .
4. :"
5. Flash MX Actions. Actions Toolbox - Flash TJI Components Index.
6. Flash MX.
7. ActionsPanel. xml Actions :
type="event" object="MovieClip" />
AsColorSyntax.xml AsColorSyntax.xml
, Script. - ActionScript . -. , - . -, , , , - .
AsColorSyntax.xml . , identifier, keyword property. , Script.
. , -
XML-.
ActionsPanel. xml.
, ,
Script. identifiers , -
ActionScript. keywords properties - , .
.text ,
Script.
AsCodeHints.xml , (,
, ) Actions Toolbox AsCodeHints.xml. , , AsCodeHints .xml . - AsCodeHints.xml -. , . , , on { ) onClipEvent ( ) ,, AsCodeHints.xml, ActionsToolbox. . AsCodeHints . xml . - , .
120 II. ActionScript
, .
, XML-.
, -
Actions Toolbox. Macromedia - on ( ) onClipEvent ( ) . , - .
pattern , Flash .
, Flash
Actions. , , - . .
pattern , Flash . -, , . , - , - ( ), (.). - . , , (*), . * , , . . 4.3 pattern .
4.3. pattern
, , pattern
.
* ,
ab.
- .
.
** .
ab.
.
bab.
b.
ab.
ba,b.
ba.b.
ab.b.
4. ActionScript 121
object - (), - .
ActionScript Rash- .
, . - , .
ActionScript . - keyframe ( ), on ( ) onClipEvent().
Actions . ,
Actions - ActionsPanel. xml, AsColorSyntax .xml, AsCodeHints.
122 II. ActionScript
ActionScript
? ? , . -, ActionScript, , - . - , ActionScript, , - .
ActionScript , - . -, , - , , . , .
ActionScript , . - " ", - :
;
;
;
;
;
.
..,
. , , s ,
npMQu-N0
:;|;" Rash- - . " -;
. " "" !
, , , - . , .
6 7, .
, -
, ("" ""), .. . , - . , -, , -. . , , .
, . , -. , . - . . - ? .
. , . - . () - , . , , ( ) , -. ( ) .
, , . , ActionScript "" , , , -, . , -, ActionScript undefined -. , - - . :myVar = " ";
myVar , (=) , . - " ".
. :
124 II. ActionScript
firstName = "";lastName = "";age = 23;
, ( ) - URL-, - .
, sa-le . ActionScript,
" ".
. -
, - , , . .
ActionScript -.
(_), ($) - . .
(_), - (S), .
.
( - Actions), "true" "false"( ).
( ).
, -, . , . - , . - , . (_) . :
first_name = "";
. , , , - . - . :firs tName = " " ;
, . , - , .
5. ActionScript 125
, . - .
- . ActionScript " " . , :MyNamemyNamemyname
"" ActionScript . ActionScript . . ( function, var break) Actions ( ).
, ,
, , (). -. ActionScript :
;
;
,
, ,
:
firstName = "";
, , . , .
, , - . -. , :
_root.movieOne.myVar = "this is a variable on one timeline";_roqt.movieTwo.myVar = "this is a variable on another timeline";
7.
var -
. :var firstName = "";
126 II. ActionScript
, - . . 6 , . - , . -, .
. - var , - .
. ActionScript ( ), - . , - .
:
function noLocal(){myVar = " ";
}
myVar = " ";noLocal();trace(myVar); // :
myVar , -, :function usesLocal(){
var myVar = " ";}
myVar = " ";usesLocal();trace(myVar); // :
myVar, , - , . myVar, .
, , - , . -, , - . , - . Flash MXActionScript Macromedia . - _global. .
, :
^global.glCounter = 1;
, - : ^global, - (.)> . , - , gl,
5. ActionScript 127
, , .
- , _global. :
trace(glCounter); // 1
, - global:
global .glcounter + + ,- // glCounter ++; // - glcounter
global. - , global .
, . . -, . , - - . , -. . , " 1', . . - , - . - . , Flash5 - _root , .
.
ActionScript : . , , , - . , - . , .
7, .
, . - , - ( . ).
128 II. ActionScript
, -
f irstName . , ( ) . (""), (").
, :firstName = "";lastName = ' ' ;firstAndLastNames = firstName + lastNarne,-age = " 2 3 " ;
f irstAndLastNames - (+) , f irstName, lastName. , "". , , - . - , :firstAndLastNames = firstName + " " + lastName;f irstAndLastNames - lastName + ", " -f firstName;
, , - . , . , -, , .
, -. . , -. , . -, . , . - ;myVar = " ";myVar = ' 1;
| -;myVar = " ';myVar = ' ";myVar = " ;
, . , , :question = ' ?'; , - . - , ;question = " ?";
5. ActionSccipt 129
. , . , , . - , 15.
age ;
age = " 2 3 " ;
age , . , ("") . age - , , :age = 23;
, - . ( -), .
, :myAge = 23;requiredAge = 21;ageDifference = myAge - requiredAge;if (ageDifference >= 0 ) {
tracef" ");}
ageDif f erence 2. , :myAge = "23" ;equ i redAge = "21";addedAges = myAge + requiredAge;
addedAges "2321", 44 ( ). , , !
, -, , , , . , , ... , - . :phone = 1235551212; // phone = "1235551212"; // phone = "(123) 555-1212"; // phone = (123) 555-1212; // !
/
, , C++ Java, (-6, 11, 462), {-453453, -2309802)
s"; (-4.3, -3.222) .
ActionScript . . ActionScript " " JavaScript, - .
130 II. ActionScript
, : true
false. Flash-. :
isLoggedln = true;allowAccess = false;
:
myAge = 23;requiredAge = 21;isValidAge = false,-ageDifference = myAge - requiredAge;if (ageDifference >= 0}{
isValidAge = true;
}if (isValidAge == true){
trace (" ");
} isValidAge. -
, , -, false. , ageDif ference 0 , isValidAge true.
, i f :if {isValidAge){
trace (" ");}
, - , if. - - ,
. , . - , Flash-. , , , , , . ActionScript , .
/
, true ; false, , 1 , -
. , Flash -. , - .
, Java C++, -
, , ActionScript . , ,
5. ActionScript 131
.