Flash Lite Authoring Guidelines for the i-mode Service by NTT DoCoMo
Trademarks Add Life to the Web, Afterburner, Aftershock, Andromedia, Allaire, Animation PowerPack, Aria, Attain, Authorware, Authorware Star, Backstage, Bright Tiger, Clustercats, ColdFusion, Design In Motion, Director, Dream Templates, Dreamweaver, Drumbeat 2000, EDJE, EJIPT, Extreme 3D, Fireworks, Flash, Fontographer, FreeHand, Generator, HomeSite, JFusion, JRun, Kawa, Know Your Site, Knowledge Objects, Knowledge Stream, Knowledge Track, LikeMinds, Lingo, Live Effects, MacRecorder Logo and Design, Macrome
CONTENTS CHAPTER 1: Introduction ............................................. 5 About the i-mode service by NTT DoCoMo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 CHAPTER 2: Developing Content ...................................... 7 Navigation and key events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents
CHAPTER 1 Introduction Macromedia has created a new profile of the Flash Player called Macromedia® Flash™ Lite, designed for consumer mobile devices, including phones for the i-mode service by NTT DoCoMo. This format is designed to run optimally on devices with limited memory, processor speed, and display area. Content created for Flash Lite is most similar to Flash Player 4 content.
Chapter 1: Introduction
CHAPTER 2 Developing Content Starting with the 505i phones, the i-mode service by NTT DoCoMo supports the ability to view Flash Lite movies. The same Flash Lite functionality is available on all 505i phones, regardless of manufacturer. This chapter describes considerations for creating Flash Lite movies that run on imode phones, from general functionality to performance and size constraints. The 505i phones support Flash Lite in both English and Japanese.
Emoji i-mode phones support special pictographic characters called Emoji. The following characters are examples of Emoji: These are encoded by replacing characters in the standard Shift-JIS table. As long as the phone’s font supports Emoji encoded as standard Shift-JIS characters, Flash Lite can display them. When authoring using Flash, you first need to ensure that you have Shift-JIS fonts installed on your desktop authoring system.
• The getURL() function can only be called once per keypress, and can only be used for the http, mailto, https • and tel protocols. Only the first getURL() call in a keypress statement block is executed; all subsequent getURL() calls in the same block are ignored. A button action can be assigned to launch an e-mail composition window with the address, subject, and body text fields already populated. There are two methods to do this.
Sound Flash Lite for 505i phones does not support the standard Flash Player audio formats—Raw, ADPCM or MP3. Instead, only MFi (Melody Format for i-mode) is supported. In addition, each manufacturer’s 505i phone supports the standard MFi format, plus its own proprietary extensions. Flash Lite does not support streaming sound, sound mixing, or looping of sound. Only event sound is supported and only one sound can be played at a time.
Performance Optimization CPU speed in i-mode phones varies from model to model, and is typically much slower than current desktop computers. Therefore, it is extremely important to consider movie performance and optimization from the beginning of each project. The optimization recommendations for creating any Flash movie also apply to Flash Lite movies created for i-mode phones. For the latter, their importance is amplified.
Using bitmaps Although some i-mode phones may have more than 16 bits of color resolution, Macromedia recommends optimizing bitmaps to 16 bits before importing them into Flash MX Professional 2004. Doing so reduces Flash Lite movie size and gives you more control over the final output. Also, make sure that bitmaps are imported at the size they need to be in the Flash Lite movie. Using larger than required bitmaps results in higher run-time memory requirements.
Select the Use Imported JPEG Data checkbox to use the default compression quality specified for the imported image. To specify a new quality compression setting, deselect Use Imported JPEG Data and enter a value between 1 and 100 in the Quality text box. A higher setting produces a higher image quality, but also a larger file size, so adjust the value accordingly.
Using ActionScript Because of CPU limitations, you should adhere to the following general guidelines when developing ActionScript for Flash Lite movies deployed on i-mode phones: • • • • Keep the ActionScript as simple as possible. Limit the number of loops that you use and the amount of code that each loop contains. Stop frame-based looping as soon as it is no longer needed. Avoid string and emulated array processing—it can be extremely CPU intensive. Note: Flash 4 ActionScript does not support arrays.
CHAPTER 3 Sound Embedding sound in Flash Lite movies for i-mode phones The Macromedia Flash MX Professional 2004 User Guide for Flash Lite describes the general process and tools required to embed sound in Flash Lite movies running on a phone. This chapter contains additional information, including procedures, specific to embedding sound in Flash Lite movies for 505i phones. Flash Lite content for 505i phones supports only the Melody Format for i-mode (MFi) audio format.
Associating an MFi sound file with an ActionScript sound symbol This procedure illustrates a simple case of associating an MFi sound file with an ActionScript sound symbol so the Flash MX Professional 2004 test movie player can recognize and play it. To associate an MFi file with an ActionScript symbol: 1 In your sound authoring program, create an MFi sound file and save it as MySound.mld. 2 In Flash MX Professional 2004, create a new file and name it FlashLiteSound.fla.
9 Associate the sound with the MySound.mld file by doing the following: ■ Select Window > Library and find the sound that you added earlier. Select the sound and right-click it to open the context menu. Select Properties from the context menu. The Sound Properties dialog box appears: For the Device sound option, use the file browser to find and select MySound.mld. ■ Click OK. 10 Select Control > Test Movie to start the Flash Lite 1.0 test movie player. 11 Click in the test movie player window.
Accessing sound on main and movie clip Timelines Sounds do not necessarily need to reside on a button Timeline. In fact, there may be times when it is useful to access sound that resides on either the main Timeline or a movie clip Timeline. As described earlier, to successfully playback any sound it must be attached to a button, but with this method the frame on the main or movie clip Timeline that contains the sound symbol must be called using the gotoAndPlay action within the keyPress event statement.
11 Link the sound with MySound.mld: If the Library window is not already open, select Window > Library and find the sound that you added earlier. Select the sound and right-click it to open the context menu. Select Properties from the context menu. The Sound Properties dialog box appears: For the Device sound option, use the file browser to find and select MySound.mld. ■ Click OK. 12 Select Insert > Timeline > Layer to create a new layer on the main Timeline.
Note: You can also access sound that resides in movie clip Timelines in much the same manner except you will need to use the tellTarget action in coordination with the gotoAndPlay() action.
CHAPTER 4 Testing Content Test your Flash Lite movies frequently on actual 505i phones. This advice may sound obvious, but this step is often overlooked and is especially important for developing Flash Lite movies for imode phones. No matter how much phone emulation a developer does, the final delivery remains the most important step in the development cycle. Emulation is helpful for much of the testing, but it is no substitute for testing on actual 505i phones.
To use the i-mode HTML Simulator: 1 Download and install the i-mode HTML Simulator application from the DoCoMo website (for a link to the website, see Appendix D, “References,” on page 47). Follow the online instructions. Note the folder where the program files are installed. 2 Start the i-mode HTML Simulator application. In Windows Explorer, or another program displaying filenames or icons, go to the folder where the Simulator program files are installed (noted in step 1) and double-click CSim.exe.
3 Review the i-mode HTML Simulator functions: ■ Click Function at the top of the Simulator application window. The following pop-up menu appears: The following function menu options for testing your Flash Lite movies are available: Open URL Enables you to type in the URL of the file you want the Simulator to test. You can also browse for a file on your local computer or use a bookmark. (A bookmark is a shortcut for a file URL or pathname.
Chapter 4: Testing Content
APPENDIX A Supported ActionScript This appendix lists the Flash Lite ActionScript commands and any exceptions to the standard in Flash Lite for i-mode. Action Name Description Support // (comment) Comment; indicates the beginning of a script comment. Fully supported Any characters that appear between the comment delimiter // and the end-of-line character are interpreted as a comment.
Action Name Description Support (–) subtract Operator (arithmetic); used for negating or subtracting. When used for negating, it reverses the sign of the numerical expression. When used for subtracting, it performs an arithmetic subtraction on two numerical expressions, subtracting expression2 from expression1. Fully supported Example 1: The following statement reverses the sign of the expression 2 + 3. -(2 + 3) The result is -5.
Action Name Description Support < (less than) Operator (comparison); compares two expressions and Fully supported determines whether expression1 is less than expression2 (true), or whether expression1 is greater than or equal to expression2 (false). In Flash Lite (and Flash 4), < is a numeric operator and is only used for expressions and not strings. The following examples illustrate true and false returns for < comparisons.
Action Name Description Support >= (greater than or equal to) Operator (comparison); compares two expressions and Fully supported determines whether expression1 is greater than or equal to expression2 (true), or whether expression1 is less than expression2 (false). The following examples illustrate true and false results for >= comparisons: 10 >= 5; // true 2 >= 2; // true 3 >=10; // false <> (inequality) Fully supported Operator (equality); tests the opposite of the equality operator.
Action Name Description Support || (logical OR) Operator (logical); evaluates expression1 and, if expression1 is false, evaluates expression2. The result is (true) if either or both expressions evaluate to true; the result is (false) only if both expressions evaluate to false. Fully supported The following example uses the || operator in an if statement.
Action Name Description Support & (string concatenation) Operator; used for concatenating strings. Fully supported add Operator; concatenates (combines) two or more strings. Fully supported and Fully supported Operator; performs a logical AND operation. If both expressions evaluate to true, then the entire expression is true. break Fully supported Action; appears within a loop (for, for...in, do...while or while).
Action Name Description Support fscommand() Action; allows the Flash movie to communicate with the program hosting Flash Lite. Not supported Fully supported ge (string greater than Comparison operator; returns true if the string or equal) representation for expression1 is greater than or equal to the string representation for expression2; otherwise, returns false. This action is string specific.
Action Name Description Support if Action; evaluates a condition to determine the next action in a movie. If the condition is true, Flash runs the statements that follow. Fully supported ifFrameLoaded() Action; checks whether the contents of a specific frame Fully supported are available locally. Use ifFrameLoaded to start playing a simple animation while the rest of the movie downloads int() Function; converts a decimal number to the closest integer value.
Action Name Description Support lt(string less than) Fully supported Operator (comparison); compares expression1 to expression2 and returns true if expression1 is less than or equal to expression2; otherwise, returns false. This action is string specific. The following examples illustrate true and false results for the lt operator: x =”Amy”; y=”Fred”; y lt x; // false x lt “Jane”; // true mbchr() String function; converts an ASCII code number to a multibyte character.
Action Name Description Support on(event) Handler; specifies the mouse event, or keypress that trigger an action. Partially supported. Events supported are keyPress, press, release, rollOver and rollout. Keys supported in Flash Lite for imode are: 0-9, *, # and Select. ord() String function; converts characters to ASCII code numbers. Fully supported play() Action; moves the playhead forward in the Timeline.
Action Name Description Support String() Function; returns a string representation of the specified Not supported argument as follows: If x is Boolean, the return string is true or false. If x is a number, the return string is a decimal representation of the number. If x is a string, the return string is x. If x is a movie clip, the return value is the target path of the movie clip in slash (/) notation. If x is undefined, the return value is an empty string.
Appendix A: Supported ActionScript
APPENDIX B Supported Properties This appendix lists the Flash Lite ActionScript properties and whether there are any exceptions in the Flash List for i-mode. Properties Description Support / Property; specifies or returns a reference Fully supported to the root movie Timeline. Functionality provided by this property is similar to that provided by the _root property in Flash 5.
Properties Description _framesloaded Fully supported Property (read-only); the number of frames that have been loaded from a streaming movie. This property is useful for determining whether the contents of a specific frame, and all the frames before it, have loaded and are available locally in a user’s browser. _height Property (read-only); retrieves the height Fully supported of the space occupied by a movie’s content. In Flash Lite, _height is a read-only property.
Properties Description Support _soundbuftime Property (global); establishes the number Not supported of seconds of streaming sound to prebuffer. _target Property (read-only); returns the target path of the movie clip instance specified as argument. _totalframes Property (read-only); evaluates the movie Fully supported clip specified as argument and returns the total number of frames in the movie.
Appendix B: Supported Properties
APPENDIX C Warning and Error Messages This appendix lists the possible information, warning, and error messages you might encounter when creating movies for Flash Lite for i-mode. Message Identifier Message Explanation SWFS016 Detected loadMovie() will be ignored. The Flash player detected that the SWF movie contains a loadMovie() ActionScript command, which the specified device’s Flash Lite does not support. No modifications are made to the device-specific SWF file - this is just a warning.
Message Identifier Message SWFS021 _droptarget property not The Flash player detected that the SWF supported. movie contains a getProperty() or setProperty() ActionScript command referring to the _droptarget property, which Flash Lite does not support. No modifications are made to the device-specific SWF file – this is just a warning. SWFS023 _soundbuftime property not supported.
Message Identifier Message Explanation SWFS035 _url property not supported. The Flash player detected that the SWF movie contains a getProperty or setProperty Actionscript command referring to the _url property, which is not supported by Flash Lite. No modifications will be made to the device specific SWF file - this is just a warning SWFS036 Detected loadMovie restrictions may apply.
Message Identifier Message Explanation SWFS042 Nellymoser Sound found. The Flash player detected that the SWF movie contains Nellymoser sound, which is not supported by the specified device’s Flash Player. No modifications will be made to the device-specific SWF file - this is just a warning SWFS043 MP3 Sound found. The Flash player detected that the SWF movie contains MP3 sound, which is not supported by the specified device’s Flash Player.
Message Identifier Message Explanation FTPA005 The call to getURL() for was ignored because there was more than one request per keypress. While testing the movie, multiple ActionScript getURL() commands were called during a keypress event. Flash Lite for i-mode only allows one getURL() command per keypress, so only the first command is processed – the others are ignored. FTPA006 The call to getURL() for was ignored because it was not associated with a keypress.
Message Identifier Message Explanation FTPS023 MP3 sounds not supported. While testing the movie, an MP3 sound was encountered. The specified device’s Flash Player does not support MP3 sound format. FTPS024 MIDI/MFI sounds not supported. While testing the movie, an MIDI/MFI sound was encountered. The specified device’s Flash Player does not support MIDI/MFI sound format. FTPS025 PCM sounds not supported. While testing the movie, an PCM sound was encountered.
APPENDIX D References The following websites contain further information about creating content for Flash Lite and Flash Lite for i-mode: Macromedia websites Information and resources for developing content for Flash Lite and Flash Lite for i-mode is available at several Macromedia websites. • Macromedia Flash MX Professional 2004 Designer and Developer website: http://www.macromedia.
Appendix D: References