User manual MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE REFERENCE

DON'T FORGET : ALWAYS READ THE USER GUIDE BEFORE BUYING !!!

If this document matches the user guide, instructions manual or user manual, feature sets, schematics you are looking for, download it now. Diplodocs provides you a fast and easy access to the user manual MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE REFERENCE. We hope that this MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE REFERENCE user guide will be useful to you.


MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE REFERENCE : Download the complete user guide (12236 Ko)

Manual abstract: user guide MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE REFERENCE

Detailed instructions for use are in the User's Guide.

[. . . ] Flash Lite 2. x ActionScript Language Reference Trademarks 1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central, ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite, FlashPaper, Flash Video Endocer, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder, Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit, Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally. [. . . ] The last line uses addListener() to register the listener with the Key object so that it can receive notification from the key down event and display information in the Output panel. var keyListener:Object = new Object(); keyListener. onKeyDown = function() { if (Key. isDown(Key. INSERT)) { trace("You pressed the Insert key. "); } }; Key. addListener(keyListener); isDown (Key. isDown method) public static isDown(code:Number) : Boolean Returns true if the key specified in code is pressed; false otherwise. Availability: ActionScript 1. 0; Flash Lite 2. 0 Parameters code:Number - The key code value assigned to a specific key or a Key class property associated with a specific key. Returns Boolean - The value true if the key specified in code is pressed; false otherwise. Example The following script lets the user control the location of a movie clip (car_mc): car_mc. onEnterFrame = function() { if (Key. isDown(Key. RIGHT)) { this. _x += 10; } else if (Key. isDown(Key. LEFT)) { this. _x -= 10; } }; Key 381 LEFT (Key. LEFT property) public static LEFT : Number The key code value for the Left Arrow key (37). Availability: ActionScript 1. 0; Flash Lite 2. 0 Example The following example moves a movie clip called car_mc a constant distance (10) when you press the arrow keys. Give a sound in the library a linkage identifier of horn_id for this example. var DISTANCE:Number = 10; var horn_sound:Sound = new Sound(); horn_sound. attachSound("horn_id"); var keyListener_obj:Object = new Object(); keyListener_obj. onKeyDown = function() { switch (Key. getCode()) { case Key. SPACE : horn_sound. start(); break; case Key. LEFT : car_mc. _x -= DISTANCE; break; case Key. UP : car_mc. _y -= DISTANCE; break; case Key. RIGHT : car_mc. _x += DISTANCE; break; case Key. DOWN : car_mc. _y += DISTANCE; break; } }; Key. addListener(keyListener_obj); 382 ActionScript classes _listeners (Key. _listeners property) public static _listeners : Array [read-only] A list of references to all listener objects registered with the Key object. This property is intended for internal use, but may be useful if you want to ascertain the number of listeners currently registered with the Key object. Objects are added and removed from this array by calls to the addListener() and removelistener() methods. Availability: ActionScript 1. 0; Flash Lite 2. 0 Example The following example shows how to use the length property to ascertain the number of listener objects currently registered to the Key object. var myListener:Object = new Object(); myListener. onKeyDown = function () { trace ("You pressed a key. "); } Key. addListener(myListener); trace(Key. _listeners. length); // Output: 1 onKeyDown (Key. onKeyDown event listener) onKeyDown = function() {} Notified when a key is pressed. You can then define a function for onKeyDown and use addListener() to register the listener with the Key object, as shown in the following example: var keyListener:Object = new Object(); keyListener. onKeyDown = function() { trace("DOWN -> Code: "+Key. getCode()+"\tACSII: "+Key. getAscii()+"\tKey: "+chr(Key. getAscii())); }; keyListener. onKeyUp = function() { trace("UP -> Code: "+Key. getCode()+"\tACSII: "+Key. getAscii()+"\tKey: "+chr(Key. getAscii())); }; Key. addListener(keyListener); Listeners enable different pieces of code to cooperate because multiple listeners can receive notification about a single event. Availability: ActionScript 1. 0; Flash Lite 2. 0 See also addListener (Key. addListener method) Key 383 onKeyUp (Key. onKeyUp event listener) onKeyUp = function() {} Notified when a key is released. You can then define a function for onKeyUp and use addListener() to register the listener with the Key object, as shown in the following example: var keyListener:Object = new Object(); keyListener. onKeyDown = function() { trace("DOWN -> Code: "+Key. getCode()+"\tACSII: "+Key. getAscii()+"\tKey: "+chr(Key. getAscii())); }; keyListener. onKeyUp = function() { trace("UP -> Code: "+Key. getCode()+"\tACSII: "+Key. getAscii()+"\tKey: "+chr(Key. getAscii())); }; Key. addListener(keyListener); Listeners enable different pieces of code to cooperate because multiple listeners can receive notification about a single event. Availability: ActionScript 1. 0; Flash Lite 2. 0 See also addListener (Key. addListener method) PGDN (Key. PGDN property) public static PGDN : Number The key code value for the Page Down key (34). Availability: ActionScript 1. 0; Flash Lite 2. 0 Example The following example rotates a movie clip called car_mc when you press the Page Down and Page Up keys. var keyListener:Object = new Object(); keyListener. onKeyDown = function() { if (Key. isDown(Key. PGDN)) { car_mc. _rotation += 5; } else if (Key. isDown(Key. PGUP)) { car_mc. _rotation -= 5; } }; Key. addListener(keyListener); 384 ActionScript classes PGUP (Key. PGUP property) public static PGUP : Number The key code value for the Page Up key (33). Availability: ActionScript 1. 0; Flash Lite 2. 0 Example The following example rotates a movie clip called car_mc when you press the Page Down and Page Up keys. var keyListener:Object = new Object(); keyListener. onKeyDown = function() { if (Key. isDown(Key. PGDN)) { car_mc. _rotation += 5; } else if (Key. isDown(Key. PGUP)) { car_mc. _rotation -= 5; } }; Key. addListener(keyListener); removeListener (Key. removeListener method) public static removeListener(listener:Object) : Boolean Removes an object previously registered with Key. addListener(). Availability: ActionScript 1. 0; Flash Lite 2. 0 Parameters listener:Object - An object. Returns Boolean listener - If the listener was successfully removed, the method returns true. If the was not successfully removed (for example, because the listener was not on the Key objects listener list), the method returns false. Key 385 Example The following example moves a movie clip called car_mc using the Left and Right arrow keys. The listener is removed when you press Escape, and car_mc no longer moves. var keyListener:Object = new Object(); keyListener. onKeyDown = function() { switch (Key. getCode()) { case Key. LEFT : car_mc. _x -= 10; break; case Key. RIGHT : car_mc. _x += 10; break; case Key. ESCAPE : Key. removeListener(keyListener); } }; Key. addListener(keyListener); RIGHT (Key. RIGHT property) public static RIGHT : Number The key code value for the Right Arrow key (39). Availability: ActionScript 1. 0; Flash Lite 2. 0 Example The following example moves a movie clip called car_mc a constant distance (10) when you press the arrow keys. Give a sound in the library a linkage identifier of horn_id for this example. var DISTANCE:Number = 10; var horn_sound:Sound = new Sound(); horn_sound. attachSound("horn_id"); var keyListener_obj:Object = new Object(); keyListener_obj. onKeyDown = function() { switch (Key. getCode()) { case Key. SPACE : horn_sound. start(); break; case Key. LEFT : car_mc. _x -= DISTANCE; break; case Key. UP : car_mc. _y -= DISTANCE; 386 ActionScript classes break; case Key. RIGHT : car_mc. _x += DISTANCE; break; case Key. DOWN : car_mc. _y += DISTANCE; break; } }; Key. addListener(keyListener_obj); SHIFT (Key. SHIFT property) public static SHIFT : Number The key code value for the Shift key (16). Availability: ActionScript 1. 0; Flash Lite 2. 0 Example The following example scales car_mc when you press Shift. var keyListener:Object = new Object(); keyListener. onKeyDown = function() { if (Key. isDown(Key. SHIFT)) { car_mc. _xscale = 2; car_mc. _yscale = 2; } else if (Key. isDown(Key. CONTROL)) { car_mc. _xscale /= 2; car_mc. _yscale /= 2; } }; Key. addListener(keyListener); SPACE (Key. SPACE property) public static SPACE : Number The key code value for the Spacebar (32). Availability: ActionScript 1. 0; Flash Lite 2. 0 Key 387 Example The following example moves a movie clip called car_mc a constant distance (10) when you press the arrow keys. Give a sound in the library a linkage identifier of horn_id for this example. var DISTANCE:Number = 10; var horn_sound:Sound = new Sound(); horn_sound. attachSound("horn_id"); var keyListener_obj:Object = new Object(); keyListener_obj. onKeyDown = function() { switch (Key. getCode()) { case Key. SPACE : horn_sound. start(); break; case Key. LEFT : car_mc. _x -= DISTANCE; break; case Key. UP : car_mc. _y -= DISTANCE; break; case Key. RIGHT : car_mc. _x += DISTANCE; break; case Key. DOWN : car_mc. _y += DISTANCE; break; } }; Key. addListener(keyListener_obj); TAB (Key. TAB property) public static TAB : Number The key code value for the Tab key (9). Availability: ActionScript 1. 0; Flash Lite 2. 0 Example The following example creates a text field, and displays the date in the text field when you press Tab. this. createTextField("date_txt", this. getNextHighestDepth(), 0, 0, 100, 22); date_txt. autoSize = true; var keyListener:Object = new Object(); keyListener. onKeyDown = function() { if (Key. isDown(Key. TAB)) { var today_date:Date = new Date(); 388 ActionScript classes date_txt. text = today_date. toString(); } }; Key. addListener(keyListener); When using this example, make sure that you select Control > Disable Keyboard Shortcuts in the test environment. UP (Key. UP property) public static UP : Number The key code value for the Up Arrow key (38). [. . . ] Support of deprecated elements in the future is not guaranteed. 3 Deprecated Function summary Modifiers Function Name call(frame:Object) Description Deprecated since Flash Player 5. This function was deprecated in favor of String. fromCharCode(). chr(number:Number)String ifFrameLoaded([scene:String], Deprecated since Flash Player 5. Macromedia frame:Object) recommends that you use the MovieClip. _framesloaded property. This function was deprecated in favor of Math. floor() for positive values and Math. ceil for negative values. [. . . ]

DISCLAIMER TO DOWNLOAD THE USER GUIDE MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE REFERENCE




Click on "Download the user Manual" at the end of this Contract if you accept its terms, the downloading of the manual MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE REFERENCE will begin.

 

Copyright © 2015 - manualRetreiver - All Rights Reserved.
Designated trademarks and brands are the property of their respective owners.