Introduction to Flash Lite 2.
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 eith
Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Guide to instructional media. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Additional resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Typographical conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Chapter 1: Unsupported and Partially Supported ActionScript Elements . . . .
Introduction Macromedia Flash Lite 1.0 and Flash Lite 1.1, the first versions of Flash Lite, are based on Macromedia Flash Player 4. Flash Lite 2.0 is based on Flash Player 7, but differs from it in the following respects: ■ It does not support ActionScript 2.0 (as used with Flash Player 7 for Flash desktop applications). ■ It supports some features only partially. ■ It adds some features specifically for mobile devices.
■ Learning ActionScript 2.0 in Flash describes how to write ActionScript for Flash Player 7. Cross references in Introduction to Flash Lite 2.x ActionScript detail the sections of Learning ActionScript 2.0 in Flash that apply to Flash Lite. ■ The Flash Lite sample applications demonstrate key concepts and best practices discussed or mentioned in the written documentation.
CHAPTER 1 1 Unsupported and Partially Supported ActionScript Elements This chapter describes the global functions and properties, constants, operators, statements, extensions, and keywords that are either partially supported or not supported by ActionScript for Flash Lite 2.0. Commands issued through fsCommand and fsCommand2. . . . . . . . . . . . . . . . . . . . . 7 Commands partially supported or unsupported by fsCommand . . . . . . . . . . . . . . . . . 8 Partially supported global properties . . . . .
Commands unsupported and partially supported by fsCommand The following table lists the commands that are unsupported by fsCommand() when using ActionScript 2.0 to create Flash Lite content. Command Description quit Closes the projector. fullscreen Specifying true sets Flash Player to full-screen mode. Specifying false returns the player to normal menu view. allowscale Specifying false sets the player so the SWF file is always drawn at its original size and is never scaled.
Command, function, or keyword Description Support onClipEvent Event handler; triggers actions defined for a specific instance of a movie clip. Limitations: Supported events are press, load, unload, enterFrame, keyDown, keyup, and data. The mouseDown, mouseUp, and mouseMove events are supported if either System.capabilities.hasMouse or System.capabilities.hasStylus are set to true. Partially supported onUpdate The onUpdate event handler is defined for a live preview used with a component.
Partially supported global properties The following table lists the ActionScript global properties that are partially supported by Flash Lite 2.0. Properties Description _droptarget Partially Read-only property that returns the absolute path in supported slash (/) syntax notation of the movie clip instance on which the draggableInstanceName (the name of a movie clip instance that was the target of a startDrag() function was dropped. This property always returns a path that starts with a slash (/).
CHAPTER 2 2 Unsupported and Partially Supported Classes This chapter describes ActionScript 2.0 classes that are either partially or not supported by Flash Lite 2.0. It also describes the extensions that are specific to ActionScript for Flash Lite 2.0. Button class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Date class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Property summary The following table lists the properties that are either partially or not supported by the Button class when using ActionScript for Flash Lite 2.0. Property Description Support menu An object that associates a ContextMenu object with a button. Not supported trackAsMenu A Boolean value that indicates whether other buttons can receive mouse release events. Supported if System.capabilities.hasMouse or System.capabilities.hasStylus are set to true.
Event Description Support onDragOver Invoked when the pointer is dragged over the button. Supported if System.capabilities.hasMouse or System.capabilities.hasStylus are set to true. Partially supported onReleaseOutside Invoked when the mouse is released while the pointer is outside the button after the button is pressed while the pointer is inside the button. Limitations: Supported if System.capabilities.hasMouse or System.capabilities.hasStylus are set to true.
Method Description getLocaleShortDate() This function sets a parameter to a string that represents the current date, in abbreviated form, formatted according to the currently defined locale. The parameter is passed in by name. The returned value is a multiple-character, variable-length string. The actual formatting depends on the device and the locale. getLocaleTime() This function sets a parameter to a string that represents the current time, formatted according to the currently defined locale.
The Flash Lite 2.0 implementation of the getCode() method returns a string or a number, depending on what the platform passed in. The only valid key codes are the standard key codes accepted by this class and the “special” key codes listed as properties of the ExtendedKey class. This restriction is enforced by the player. For valid key code values, see the Key class in the Flash Lite 2.x ActionScript Language Reference.
Event summary The following table lists the events that are either partially or not supported by the Mouse class when using ActionScript for Flash Lite 2.0. Event Description Support onMouseDown Notified when the mouse is pressed. Limitations: Supported if System.capabilities.hasMouse or System.capabilities.hasStylus are set to true. Partially supported onMouseMove Notified when the mouse moves. Limitations: Supported if System.capabilities.hasMouse is set to true.
Method summary The following table lists the methods that are either partially or not supported by the MovieClip class when using ActionScript for Flash Lite 2.0. Method Description Support attachAudio() Captures and plays local audio from the devices microphone hardware. Not supported getTextSnapshot() Returns a TextSnapshot object that contains the text in the static text fields in the specified movie clip.
Property summary The following table lists the properties that are either partially or not supported by the MovieClip class when using ActionScript for Flash Lite 2.0. Property Description _droptarget Returns the absolute path in slash-syntax notation Partially of the movie clip instance on which this movie clip supported was dropped. The _droptarget property always returns a path that starts with a slash (/).
Property Description Support _xmouse Returns the x coordinate of the mouse position. Limitations: Supported if System.capabilities.hasMouse=true or System.capabilities.hasStylus=true. Partially supported _ymouse Returns the y coordinate of the mouse position. Limitations: Supported if System.capabilities.hasMouse or System.capabilities.hasStylus are set to true.
Event Handler Description Support onMouseMove Invoked every time the mouse moves. Limitations: Supported if System.capabilities.hasMouse is set to true. Partially supported onMouseUp Invoked every time the left mouse button is pressed. Limitations: Supported if System.capabilities.hasMouse or System.capabilities.hasStylus are set to true.
Method summary The following table lists the methods that are partially supported by the SharedObject class when using ActionScript for Flash Lite 2.0. Method Description Support flush() Immediately writes a locally persistent shared object to a local file. Limitations: The write operation is asynchronous and the result is not immediately available. Partially supported getLocal() Returns a reference to a locally persistent shared Partially object that is available only to the current client.
Method summary The following table lists the methods that are not supported by the System class when using ActionScript for Flash Lite 2.0. Method Description Support setClipboard() Replaces the contents of the Clipboard with a specified text string. Not supported showSettings() Shows the specified Flash Player Settings panel. Not supported Property summary The following table lists the properties that are not supported by the System class for use with ActionScript for Flash Lite 2.0.
capabilities (System.capabilities) class The System.capabilities class determines the abilities of the system and player hosting a SWF file, which lets you tailor content for different formats. For example, the screen of a cell phone (black and white, 100 square pixels) is different than the 1000-square-pixel color PC screen. To provide appropriate content to as many users as possible, you can use the System.capabilities object to determine the type of device a user has.
Flash Lite property extensions The following table lists properties that are extensions to the System.capabilites class for use with ActionScript for Flash Lite 2.0. Property Description hasCompoundSound A read-only Boolean value that is true if the player can process compound sound data; false otherwise. hasEmail A read-only Boolean value that is true if the player can send e-mail messages using the GetURL ActionScript command; false otherwise.
Property Description hasMouse A read-only Boolean value that is true if the player can send mouserelated events and false if the platform does not support a mouse. hasMappableSoftKeys Allows user to set soft-key values and handle events from those soft keys. hasStylus A read-only Boolean value that is true if the player can send stylusrelated events and false if the platform does not support a stylus. The onMouseMove event is not supported by a stylus.
Sound class ActionScript for Flash Lite 2.0 supports device sound through the Sound class and through System.capabilities values. The Sound class is fully supported for native sounds supported in Flash Player 7, but it is only partially supported for device sounds. Flash Lite 2.0 adds support that lets you synchronize device sound playback with rendering animation. NO TE Flash Lite 2.0 does not support sound recording.
Method Description Support setPan() Determines how the sound is played in the left and Partially right channels (speakers). For mono sounds, pan supported determines which speaker (left or right) the sound plays through. Limitations: Supported for use with native Flash sound; not supported for use with device sound. setTransform() Sets the sound transform (or balance) information, Partially supported for a Sound object.
Flash Lite method extensions The following table lists new methods in the Sound class that are specific to ActionScript for Flash Lite 2.0. Method Description getPan() Returns the value of the previous setPan() call. This method is not supported for device sound. getTransform() Returns the value of the previous setTransform() call. This method is not supported for device sound. loadSound() Loads sound data of any format into Flash Player.
Property Description getTransform() Returns the value of the previous setTransform() call. This method is not supported for device sound. loadSound() Loads sound data of any format into Flash Player. This method is different from the Flash Player 7 version because sound data loaded using this method is always treated as event sound, so the second parameter of this method is always ignored. For example, in the following call, the value true is ignored: my_sound.loadSound("mysnd.
TextFormat class The TextFormat class represents character formatting information. Use the TextFormat class to create specific text formatting for text fields. You can apply text formatting to static and dynamic text fields. Some properties of the TextFormat class are not available for embedded and device fonts. The TextFormat class lets you apply formatting to a text field or to certain characters within a text field.
Property summary The following table lists the properties that are partially supported when using ActionScript 2.0 to create Flash content. Property Description Support bold A Boolean value that specifies whether the text is boldface. Limitations: For use only with paragraph-level formatting; you cannot apply bold to individual characters. Partially supported bullet A Boolean value that indicates that the text is part Partially of a bulleted list.
Video class Flash Lite 2.0 lets you work with device-specific video formats, and supports the following types of video playback: ■ Video embedded in a SWF file ■ Video available as a separate file on the device ■ Video streamed over the network (in real time) Flash Lite 2.0 supports device video. Device video is stored in the published SWF file in the device’s native video format. To play the device video, Flash Lite passes the video data to the device, which then decodes and plays the video.
Property summary The following table lists the properties of the Video class that are not supported when using ActionScript for Flash Lite 2.0. Property Description Support deblocking Indicates the type of deblocking filter applied to decoded video as part of postprocessing. Two deblocking filters are available: one in the Sorenson codec and one in the On2 VP6 codec. Not supported height An integer specifying the height of the video stream, in pixels.
Unsupported and Partially Supported Classes