- Page 1 and 2:
FLASH ® LITE 2.x AND 3.0 ACTIONSC
- Page 3 and 4:
Contents Chapter 1: ActionScript la
- Page 5 and 6:
_capSMAF property . . . . . . . . .
- Page 7 and 8:
for statement. . . . . . . . . . .
- Page 9 and 10:
onDragOut (Button.onDragOut handler
- Page 11 and 12:
getDate (Date.getDate method). . .
- Page 13 and 14:
LoadVars . . . . . . . . . . . . .
- Page 15 and 16:
moveTo (MovieClip.moveTo method). .
- Page 17 and 18:
valueOf (Number.valueOf method) . .
- Page 19 and 20:
autoSize (TextField.autoSize proper
- Page 21 and 22:
getBytesLoaded (XML.getBytesLoaded
- Page 23 and 24:
CHAPTER 1 ActionScript language ele
- Page 25 and 26:
Parameters [path]filename.as - file
- Page 27 and 28:
Constants summary Modifiers Constan
- Page 29 and 30:
Lisa 30 See also trace function nul
- Page 31 and 32:
trace("x is not undefined"); } trac
- Page 33 and 34:
Modifiers Signature Description int
- Page 35 and 36:
Modifiers Signature Description set
- Page 37 and 38:
Example var myArray:Array = Array()
- Page 39 and 40:
var b:Boolean = new Boolean(1); //
- Page 41 and 42:
Creates an instance of a movie clip
- Page 43 and 44:
In Flash 4, you can also use eval()
- Page 45 and 46:
parameters:String - A string passed
- Page 47 and 48:
Example The following example creat
- Page 49 and 50:
var age:Number = 92; getURL("http:/
- Page 51 and 52:
Example In the following example, a
- Page 53 and 54:
isNaN function isNaN(expression:Obj
- Page 55 and 56:
When a SWF file is loaded into a ta
- Page 57 and 58:
The loadMovieNum() action also lets
- Page 59 and 60:
Example The following example loads
- Page 61 and 62:
trace(i+": "+_level2[i]); } trace("
- Page 63 and 64:
See also substr (String.substr meth
- Page 65 and 66:
■ If expression is undefined, the
- Page 67 and 68:
■ dragOut While the pointer is ov
- Page 69 and 70:
this._parent.prevFrame(); } } The f
- Page 71 and 72:
Example The examples in this sectio
- Page 73 and 74:
Returns a random integer between 0
- Page 75 and 76:
Usage 2: The following example defi
- Page 77 and 78:
See also clearInterval function set
- Page 79 and 80:
stopAllSounds function stopAllSound
- Page 81 and 82:
Returns String - A string. Example
- Page 83 and 84:
Example This tellTarget statement c
- Page 85 and 86:
*/ unescape function unescape(x:Str
- Page 87 and 88:
See also loadMovieNum function, unl
- Page 89 and 90:
Modifiers Property Description _cap
- Page 91 and 92:
msg = "Use your directional joypad
- Page 93 and 94:
_capMFi property _capMFi Deprecated
- Page 95 and 96:
Deprecated since Flash Lite Player
- Page 97 and 98:
If the global _focusrect property i
- Page 99 and 100:
Specifies the level of anti-aliasin
- Page 101 and 102:
_quality property _quality:String S
- Page 103 and 104:
See also maxscroll (TextField.maxsc
- Page 105 and 106:
obj.func = function() { return true
- Page 107 and 108:
Operator Description >>>= (bitwise
- Page 109 and 110:
Operator Description and (logical A
- Page 111 and 112:
var name:String = "Cola"; var instr
- Page 113 and 114:
var employee:Array = [15, "Barbara"
- Page 115 and 116:
You can also use the array access (
- Page 117 and 118:
Returns Number - The result of the
- Page 119 and 120:
Example In the following example, t
- Page 121 and 122:
var ReadOnlyFlag:Number = 0x0001; /
- Page 123 and 124:
var y:Number = 9; // 1111 |= 1001 =
- Page 125 and 126:
Example The following commented cod
- Page 127 and 128:
^ bitwise XOR operator expression1
- Page 129 and 130:
Operands comment - Any characters.
- Page 131 and 132:
Note: Flash Lite 2.0 also deprecate
- Page 133 and 134:
The following example loops from 10
- Page 135 and 136:
Example The following example ident
- Page 137 and 138:
See also ! logical NOT operator, !=
- Page 139 and 140:
Returns Boolean - The Boolean resul
- Page 141 and 142:
a.push(++i); } trace(a.toString());
- Page 143 and 144:
trace(a!=b); // true a = b; trace(a
- Page 145 and 146:
trace(3 < 10); // true trace(10 < 3
- Page 147 and 148:
Indicates the beginning of a script
- Page 149 and 150:
! logical NOT operator ! expression
- Page 151 and 152:
The message the logical OR test pas
- Page 153 and 154:
Operands expression1 : Number - A n
- Page 155 and 156:
Operands constructor : Object - A f
- Page 157 and 158:
The following example uses the info
- Page 159 and 160:
Operands expression1 : Object - A n
- Page 161 and 162:
trace(s1 == s2); // true trace(s1 =
- Page 163 and 164:
Operands expression1 : Number - A n
- Page 165 and 166:
Returns String - A String represent
- Page 167 and 168:
Statement Description import Lets y
- Page 169 and 170:
Note: You should always end the sta
- Page 171 and 172:
this.bloomSeason = param_bloomSeaso
- Page 173 and 174:
continue; } trace(i); } See also do
- Page 175 and 176:
Usage 2: The following example dele
- Page 177 and 178:
Type checking on dynamic classes is
- Page 179 and 180:
Use the elseif statement to create
- Page 181 and 182:
A subclass of the Vehicle class can
- Page 183 and 184:
The for..in statement iterates over
- Page 185 and 186:
Example The following example defin
- Page 187 and 188:
Parameters condition:Boolean - An e
- Page 189 and 190:
import macr.util.*; var myFoo:foo =
- Page 191 and 192:
See also class statement intrinsic
- Page 193 and 194:
Example The following example demon
- Page 195 and 196:
Returns String - The evaluated expr
- Page 197 and 198:
Variables can hold any data type (f
- Page 199 and 200:
var user2:Users = new Users(); trac
- Page 201 and 202:
Example In this example, a function
- Page 203 and 204:
Example The following example shows
- Page 205 and 206:
throw new RecordSetException(); } e
- Page 207 and 208:
Looping is commonly used to perform
- Page 209 and 210:
gotoAndStop(3); } The following cod
- Page 211 and 212:
Command Description SetSoftKeys Rem
- Page 213 and 214:
Example The following example assig
- Page 215 and 216:
Example The following example sets
- Page 217 and 218:
Returns the generation of the curre
- Page 219 and 220:
case 2: _root.myText += "pending re
- Page 221 and 222:
Note: This command is not supported
- Page 223 and 224:
This command is supported only when
- Page 225 and 226:
InputTextType Mode Sets the FEP to
- Page 227 and 228:
If a vibration is already occurring
- Page 229 and 230:
CHAPTER 2 ActionScript classes Docu
- Page 231 and 232:
length (arguments.length property)
- Page 233 and 234:
Properties inherited from class Obj
- Page 235 and 236:
Example Usage 1: The following exam
- Page 237 and 238:
trace(x_array[0]); // a trace(x_arr
- Page 239 and 240:
trace(my_array); // outputs: a,b,un
- Page 241 and 242:
var numbers_array:Array = new Array
- Page 243 and 244:
■ Numeric fields are sorted as if
- Page 245 and 246:
sortOn (Array.sortOn method) public
- Page 247 and 248:
for(i=0; i
- Page 249 and 250:
var myPets_array:Array = new Array(
- Page 251 and 252:
Boolean Object | +-Boolean public c
- Page 253 and 254:
Example The following example shows
- Page 255 and 256:
Modifiers Property Description Prop
- Page 257 and 258:
enabled (Button.enabled property) p
- Page 259 and 260:
trace(myBtn1_btn.getDepth()); trace
- Page 261 and 262:
Note: The onDragOut Event Handler i
- Page 263 and 264:
onKeyUp (Button.onKeyUp handler) on
- Page 265 and 266:
Invoked when a button is released.
- Page 267 and 268:
_parent (Button._parent property) p
- Page 269 and 270:
Note: Although you can specify this
- Page 271 and 272:
_target (Button._target property) p
- Page 273 and 274:
trace("clicked "+this._name); var u
- Page 275 and 276:
this.createTextField("mouse_txt", 9
- Page 277 and 278:
var table_str:String = ""; table_st
- Page 279 and 280:
Modifiers Property Description stat
- Page 281 and 282:
Modifiers Property Description stat
- Page 283 and 284:
A Boolean value that is true if the
- Page 285 and 286:
hasDataLoading (capabilities.hasDat
- Page 287 and 288:
Example The following example trace
- Page 289 and 290:
Example The following example trace
- Page 291 and 292:
hasStreamingAudio (capabilities.has
- Page 293 and 294:
isDebugger (capabilities.isDebugger
- Page 295 and 296:
Note: For Flash Lite 2.0, the value
- Page 297 and 298:
softKeyCount (capabilities.softKeyC
- Page 299 and 300:
Methods inherited from class Object
- Page 301 and 302:
Example This example sets the RGB c
- Page 303 and 304:
The Date class handles daylight sav
- Page 305 and 306:
Modifiers Signature Description get
- Page 307 and 308:
Modifiers Signature Description set
- Page 309 and 310:
minute:Number [optional] - An integ
- Page 311 and 312:
getHours (Date.getHours method) pub
- Page 313 and 314:
Returns String - A string represent
- Page 315 and 316:
Returns Number - An integer. Exampl
- Page 317 and 318:
Example The following example creat
- Page 319 and 320:
Returns Number - An integer. Exampl
- Page 321 and 322:
var today_date:Date = new Date(2004
- Page 323 and 324:
var my_date:Date = new Date(2004,4,
- Page 325 and 326:
Parameters second:Number - An integ
- Page 327 and 328:
month:Number [optional] - An intege
- Page 329 and 330:
setUTCMinutes (Date.setUTCMinutes m
- Page 331 and 332:
setYear (Date.setYear method) publi
- Page 333 and 334:
Returns Number - The number of mill
- Page 335 and 336:
Example In the following example, a
- Page 337 and 338:
See also message (Error.message pro
- Page 339 and 340:
The key code value for the SOFT1 so
- Page 341 and 342:
Function Object | +-Function public
- Page 343 and 344:
create arrays to pass as a paramete
- Page 345 and 346:
Property summary Modifiers Property
- Page 347 and 348:
Example The following example creat
- Page 349 and 350:
DOWN (Key.DOWN property) public sta
- Page 351 and 352:
var keyListener:Object = new Object
- Page 353 and 354:
The following example adds a call t
- Page 355 and 356:
The key code value for the Left Arr
- Page 357 and 358:
Listeners enable different pieces o
- Page 359 and 360:
horn_sound.attachSound("horn_id");
- Page 361 and 362:
} }; Key.addListener(keyListener);
- Page 363 and 364:
Event summary Event Description onD
- Page 365 and 366:
Example The following example adds
- Page 367 and 368:
Example The following example uses
- Page 369 and 370:
Downloads variables from the specif
- Page 371 and 372:
Example The following example creat
- Page 373 and 374: See also onLoad (XML.onLoad handler
- Page 375 and 376: Parameters url:String - A string; t
- Page 377 and 378: The following is an example of pass
- Page 379 and 380: Modifiers Signature Description sta
- Page 381 and 382: atan (Math.atan method) public stat
- Page 383 and 384: Returns Number - A number from -1.0
- Page 385 and 386: LN10 (Math.LN10 property) public st
- Page 387 and 388: trace(new Date(maxDate).toString())
- Page 389 and 390: line_mc.lineStyle(2, 0x000000, 100)
- Page 391 and 392: } mc.curveTo(-r+x, Math.tan(Math.PI
- Page 393 and 394: Example The following example draws
- Page 395 and 396: The listener parameter should conta
- Page 397 and 398: See also addListener (Mouse.addList
- Page 399 and 400: this.isDrawing = false; }; Mouse.ad
- Page 401 and 402: ■ The attachMovie() method allows
- Page 403 and 404: Modifiers Property Description Prop
- Page 405 and 406: Modifiers Signature Description beg
- Page 407 and 408: Modifiers Signature Description lin
- Page 409 and 410: triangle.onRollOut = function() { t
- Page 411 and 412: eginGradientFill (MovieClip.beginGr
- Page 413 and 414: } colors = [0xFF0000, 0x0000FF]; fi
- Page 415 and 416: var container:MovieClip = this.crea
- Page 417 and 418: An example is also in the animation
- Page 419 and 420: mc.curveTo(-Math.tan(Math.PI/8)*r+x
- Page 421 and 422: initObject:Object [optional] - (Sup
- Page 423: See also beginFill (MovieClip.begin
- Page 427 and 428: stop(); See also getBytesTotal (Mov
- Page 429 and 430: Returns MovieClip - A reference to
- Page 431 and 432: Returns Number - An integer that sp
- Page 433 and 434: You must first create a generic obj
- Page 435 and 436: You can extend the methods and even
- Page 437 and 438: _highquality (MovieClip._highqualit
- Page 439 and 440: if (this.hitTest(circle_mc)) { trac
- Page 441 and 442: triangle_mc.lineTo(100, 300); trian
- Page 443 and 444: The loadVariables method can also b
- Page 445 and 446: After you create a point object wit
- Page 447 and 448: Example In the following example, l
- Page 449 and 450: moveTo (MovieClip.moveTo method) pu
- Page 451 and 452: The dynamic_mc is a movie clip that
- Page 453 and 454: Example The following example defin
- Page 455 and 456: onKillFocus (MovieClip.onKillFocus
- Page 457 and 458: Example The following example defin
- Page 459 and 460: Example The following example defin
- Page 461 and 462: my_mc.onUnload = function () { trac
- Page 463 and 464: See also prevFrame function _qualit
- Page 465 and 466: See also duplicateMovieClip functio
- Page 467 and 468: Lets the user drag the specified mo
- Page 469 and 470: } mc_1.onPress = function() { this.
- Page 471 and 472: tabEnabled (MovieClip.tabEnabled pr
- Page 473 and 474: prev_mc.onRelease = function() { va
- Page 475 and 476:
_url (MovieClip._url property) publ
- Page 477 and 478:
Note: This property is supported in
- Page 479 and 480:
_ymouse (MovieClip._ymouse property
- Page 481 and 482:
The MovieClipLoader class lets you
- Page 483 and 484:
Methods inherited from class Object
- Page 485 and 486:
listener.onLoadProgress = function(
- Page 487 and 488:
Example The following example shows
- Page 489 and 490:
See also addListener (MovieClipLoad
- Page 491 and 492:
}; mclListener.onLoadComplete = fun
- Page 493 and 494:
onLoadStart (MovieClipLoader.onLoad
- Page 495 and 496:
start_button.clickHandler = functio
- Page 497 and 498:
■ You can prevent a SWF file from
- Page 499 and 500:
Example The following example dynam
- Page 501 and 502:
this.createEmptyMovieClip("progress
- Page 503 and 504:
currentFps (NetStream.currentFps pr
- Page 505 and 506:
The following events notify you whe
- Page 507 and 508:
The onMetaData event handler also r
- Page 509 and 510:
The Flash Video Exporter utility (v
- Page 511 and 512:
Parameters flag:Boolean [optional]
- Page 513 and 514:
NOTE: This method is also supported
- Page 515 and 516:
Property summary Modifiers Property
- Page 517 and 518:
NEGATIVE_INFINITY (Number.NEGATIVE_
- Page 519 and 520:
var b:Number = new Number(114); var
- Page 521 and 522:
Creates a getter/setter property. W
- Page 523 and 524:
Book.prototype.getTitle = function(
- Page 525 and 526:
Indicates whether the specified pro
- Page 527 and 528:
trace(Circle.prototype == twoCircle
- Page 529 and 530:
Returns Boolean - A Boolean value:
- Page 531 and 532:
instantiate a new object var myObje
- Page 533 and 534:
The following example shows how to
- Page 535 and 536:
See the example for Object.toString
- Page 537 and 538:
Return the value of newVal. return
- Page 539 and 540:
Occasionally, you might encounter t
- Page 541 and 542:
See also allowDomain (security.allo
- Page 543 and 544:
| +-Selection public class Selectio
- Page 545 and 546:
one_txt.border = true; one_txt.type
- Page 547 and 548:
} } this.createTextField("status_tx
- Page 549 and 550:
Example In the following example, t
- Page 551 and 552:
this.onEnterFrame = function () { S
- Page 553 and 554:
When the player has notified the li
- Page 555 and 556:
notifyFunction:Function - The name
- Page 557 and 558:
Example The following example saves
- Page 559 and 560:
var so:SharedObject = SharedObject.
- Page 561 and 562:
var my_so:SharedObject = SharedObje
- Page 563 and 564:
Parameters objectName:String - A st
- Page 565 and 566:
Modifiers Signature Description set
- Page 567 and 568:
moveTo(0, 0); lineTo(pb_width, 0);
- Page 569 and 570:
See also getBytesTotal (Sound.getBy
- Page 571 and 572:
var knob_ll:MovieClip = transform_m
- Page 573 and 574:
knob_mc._x = my_sound.getVolume();
- Page 575 and 576:
Property Description TSRC ISRC (int
- Page 577 and 578:
Example The following example displ
- Page 579 and 580:
Usage 2: The following example uses
- Page 581 and 582:
Stereo sounds divide the sound inpu
- Page 583 and 584:
The following example creates a new
- Page 585 and 586:
The Stage class is a top-level clas
- Page 587 and 588:
align (Stage.align property) public
- Page 589 and 590:
emoveListener (Stage.removeListener
- Page 591 and 592:
Property (read-only); indicates the
- Page 593 and 594:
Modifiers Signature Description sta
- Page 595 and 596:
This method is similar to String.ch
- Page 597 and 598:
trace(index); // output: 6 index =
- Page 599 and 600:
An example is also in the Strings.f
- Page 601 and 602:
output: P A T S Y The following exa
- Page 603 and 604:
Parameters start:Number - An intege
- Page 605 and 606:
Returns a copy of the String object
- Page 607 and 608:
Method summary Methods inherited fr
- Page 609 and 610:
public dynamic class TextField exte
- Page 611 and 612:
Modifiers Property Description tabI
- Page 613 and 614:
Modifiers Signature Description rep
- Page 615 and 616:
_alpha (TextField._alpha property)
- Page 617 and 618:
var myMouseListener:Object = new Ob
- Page 619 and 620:
See also border (TextField.border p
- Page 621 and 622:
Example In this example, you need t
- Page 623 and 624:
Returns a TextFormat object contain
- Page 625 and 626:
my_txt.multiline = false; my_txt.wo
- Page 627 and 628:
age_txt.border = true; age_txt.maxC
- Page 629 and 630:
A reference to the text field insta
- Page 631 and 632:
Parameters scrolledField:TextField
- Page 633 and 634:
first_txt'( _parent is: _level0 sec
- Page 635 and 636:
Returns Boolean - If listener was s
- Page 637 and 638:
" + "and select 'Enter current date
- Page 639 and 640:
Defines the vertical position of te
- Page 641 and 642:
var my_fmt:TextForma( = new TextFor
- Page 643 and 644:
See also getNewTextFormat (TextFiel
- Page 645 and 646:
one_txt.type = "input"; this.create
- Page 647 and 648:
Indicates the height of the text. E
- Page 649 and 650:
When you test this example, the URL
- Page 651 and 652:
wordWrap (TextField.wordWrap proper
- Page 653 and 654:
See also _ymouse (TextField._ymouse
- Page 655 and 656:
public class TextFormat extends Obj
- Page 657 and 658:
Methods inherited from class Object
- Page 659 and 660:
Example The following example creat
- Page 661 and 662:
The following figure illustrates th
- Page 663 and 664:
An integer that indicates the inden
- Page 665 and 666:
this.createTextField("mytext",1,100
- Page 667 and 668:
See also url (TextFormat.url proper
- Page 669 and 670:
url (TextFormat.url property) publi
- Page 671 and 672:
Property summary Properties inherit
- Page 673 and 674:
See also play (Video.play method),
- Page 675 and 676:
Example The following example resum
- Page 677 and 678:
Modifiers Property Description Prop
- Page 679 and 680:
Methods inherited from class Object
- Page 681 and 682:
Returns XMLNode - An XMLNode object
- Page 683 and 684:
If no DOCTYPE declaration was encou
- Page 685 and 686:
XML.prototype.ignoreWhite = true; E
- Page 687 and 688:
Example The following simple exampl
- Page 689 and 690:
See also onLoad (XML.onLoad handler
- Page 691 and 692:
■ _parent specifies the parent of
- Page 693 and 694:
status (XML.status property) public
- Page 695 and 696:
The following example creates an XM
- Page 697 and 698:
Modifiers Property Description Prop
- Page 699 and 700:
var doc1:XML = new XML(); var doc2:
- Page 701 and 702:
create another array and use the ch
- Page 703 and 704:
Evaluates the specified XML object
- Page 705 and 706:
Parameters newChild:XMLNode - The X
- Page 707 and 708:
An XMLNode value that references th
- Page 709 and 710:
Integer value Defined constant 3 TE
- Page 711 and 712:
} The following information is disp
- Page 713 and 714:
var cityNode:XMLNode = my_xml.first
- Page 715 and 716:
To use the methods of the XMLSocket
- Page 717 and 718:
Establishes a connection to the spe
- Page 719 and 720:
The default implementation of this
- Page 721 and 722:
Example The following function over
- Page 723 and 724:
CHAPTER 3 Deprecated ActionScript T
- Page 725 and 726:
Modifiers Property Name Description
- Page 727 and 728:
CHAPTER 4 Unsupported ActionScript
- Page 729 and 730:
Index Symbols ! logical NOT operato
- Page 731 and 732:
dispatched by MovieClipLoader 487,
- Page 733 and 734:
I id3 property 573 if statement 186
- Page 735 and 736:
onKeyUp event 263 onKillFocus event
- Page 737 and 738:
unescape function 85 UNIQUESORT pro