APPENDIXES Appendix A

APPENDIXES Appendix A

Part Four APPENDIXES Appendix A ERROR CODES This appendix lists the error codes and error messages for the various versions of Flash Lite. Table A-1 shows the error codes for errors that can occur in Flash Lite ver- sions 1.0 and 1.1, and Table A-2 shows the error codes for versions 2.0 and later. (In the later versions, the missing error code numbers 5 and 9 are by design, probably because the engineers of Flash Lite see them as unlucky numbers.) 441 APPENDIX A Table A-1. Error codes for Flash Lite 1.0 and 1.1 Error code Error message 1 Out of memory. 2 Stack limit reached. 3 Corrupt SWF data. 4 ActionScript stuck. This error can occur if the code doesn’t run within the preset time limits (normally meaning that the CPU of the device is too slow). 5 Infinite AS loop. 6 Bad JPEG data. 7 Bad sound data. 8 Cannot find host. 9 ActionScript error. 10 URL too long. Table A-2. Error codes for Flash Lite 2.0 and later Error code Error message 1 Out of memory. 2 Stack limit reached. 3 Corrupt SWF data. 4 ActionScript stuck. This error can occur if the code doesn’t run within the preset time limits (normally meaning that the CPU of the device is too slow). 6 Bad image data; corrupt or unsupported image file. 7 Bad sound data; corrupt or unsupported sound file. 8 Root movie unloaded. 10 URL too long. 11 Insufficient memory to decode image. 12 Corrupt SVG data. 13 Insufficient memory to load URL. 442 Appendix B FSCOMMAND2 COMMANDS This appendix gives a list of available FSCommand2 commands available in the different versions of the Flash Lite Player. Commands that are used by specific mobile devices won’t be listed. Please refer to the development documentation of these devices to get an insight into the available commands. Most of the FSCommand2 commands return a numeric value. If the command is not supported on the mobile device it will return -1, instead of the success value, 0 or higher. The two tables at the end of this appendix are for quick reference—print them out, and keep them at hand when you are developing your Flash Lite applications! We use the word “deprecated” in certain commands’ support information to indicate that although the command is still supported, there are other ways of accessing the given functionality. One example of this is is with the GetLocaleLongDate command. In Flash Lite 2 we can use the Date object instead, but you are still able to use the FSCommand2 command if you wish. 445 APPENDIX B Launch The Launch command enables you to launch another application on the mobile device. The command is only able to launch applications in the stand-alone Flash Lite Player. The supported parameter of this command is application-path, arg1, arg2, . , argn, with the name of the application being started and then followed with parameters separated by commas. The length of this parameter is limited, so verify that it works successfully on the mobile device of your choice. Please note that this is an fscommand() command, and the support of this is dependent on the oper- ating system of the device. Support Stand-alone Flash Lite Player only Example of usage appName = "z:\\system\\apps\\browser\\browser.app"; parameters = "http://www.flashmobilebook.com"; status = fscommand( "Launch", appName add "," add parameters ); Quit The Quit command stops playback and exits the Flash Lite stand-alone player. Support Stand-alone Flash Lite Player only Example of usage status = fscommand2( "Quit" ); Escape The Escape command encodes the given string to a format safe for network transfers; it returns the converted string in the given encoded variable. Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage original_string = "My Original String"; status = fscommand2( "Escape", original_string, "encoded_string" ); trace( "Encoded String: " add encoded_string ); // outputs: Encoded String: My%20Original%20String 446 FSCOMMAND2 COMMANDS Unescape The Unescape command decodes a given string encoded by the Escape command to its normal form; it returns the decoded string in the given encoded variable. Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage original = "My%20Original%20String"; status = fscommand2( "Unescape", original, "encoded" ); trace( "Decoded String: " add encoded ); // outputs: Decoded String: My Original String FullScreen The FullScreen command shows the Flash content using the full display area of the mobile device. This command is only supported in the stand-alone Flash Lite Player, not in the embedded browser. Support Stand-alone Flash Lite Player only Example of usage status = fscommand2( "FullScreen", true ); if ( status != 0 ) { trace( "no fullscreen support" ); } GetLocaleLongDate The GetLocaleLongDate command sets a specified variable to the long format of the current date in the currently defined locale of the mobile device. For example, it returns a format like Wednesday, May 11, 2007. Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage status = fscommand2( "GetLocaleLongDate", "current_date" ); trace( "The current date is: " add current_date ); // outputs: The current date is: Sunday, November 19, 2006 447 APPENDIX B GetLocaleShortDate The GetLocaleShortDate command sets a specified variable to the short format of the current date in the currently defined locale of the mobile device. For example, it returns a format like 11-05-2007 or 05/11/2007. Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage status = fscommand2( "GetLocaleShortDate", "current_date" ); trace( "The current date is: " add current_date ); // The current date is: 19-11-2006 GetLocaleTime The GetLocaleTime command sets a specified variable to the current time in the currently defined locale of the mobile device. For example, it returns a format like 22:56:39 or 11:56:39 PM. Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage status = fscommand2( "GetLocaleTime", "current_time" ); trace( "The current time is: " add current_time ); // outputs: The current time is: 21:27:02 GetDateDay The GetDateDay command returns the day of the current date; this is a numeric value between 1 and 31, without a leading zero. Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage current_day = fscommand2( "GetDateDay" ); trace( "The day: " add current_day ); //outputs: The day: 19 448 FSCOMMAND2 COMMANDS GetDateMonth The GetDateMonth command returns the day of the current date; this is a numeric value between 1 and 12, without a leading zero. Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage current_month = fscommand2( "GetDateMonth" ); trace( "The Month: " add current_month ); // outputs: The Month: 11 GetDateYear The GetDateYear command returns the day of the current date, this is a numeric value between 0 and 9999. Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage current_year = fscommand2( "GetDateYear" ); trace( "The Year: " add current_year ); // outputs: The Year: 2007 GetDateWeekday The GetDateWeekday command returns the number of the current weekday; this is a numeric value between 0 and 6, where 0 is Sunday, and 6 is Saturday. Table B-1 lists all the possible values. Table B-1. The possible values of the weekday Value Description 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday 449 APPENDIX B Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage current_weekday = fscommand2( "GetDateWeekday" ); trace( "The Weekday: " add current_weekday ); // outputs: The Weekday: 0 GetTimeHours The GetTimeHours command returns the hour of the current time; this is a numeric value between 0 and 23. The hour is returned in 24-hour, or military, time. Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage current_hour = fscommand2( "GetTimeHours" ); trace( "The Current Hour: " add current_hour ); // outputs: The Current Hour: 21 GetTimeMinutes The GetTimeMinutes command returns the minutes of the current time; this is a numeric value between 0 and 59. Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage current_minutes = fscommand2( "GetTimeMinutes" ); trace( "The Current Minutes: " add current_minutes ); // outputs: The Current Minutes: 29 GetTimeSeconds The GetTimeSeconds command returns the seconds of the current time; this is a numeric value between 0 and 59. 450 FSCOMMAND2 COMMANDS Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage current_seconds = fscommand2( "GetTimeSeconds" ); trace( "The Current Seconds: " add current_seconds ); // outputs: The Current Seconds: 38 GetTimeZoneOffset The GetTimeZoneOffset command returns the number of minutes between the current time zone and the universal time (UTC) in the specified variable. This numeric value can be both positive as well as negative; for example, -60 minutes is the value for European time (the Netherlands). Support Flash Lite 1.1; Flash Lite 2.X (deprecated) Example of usage status = fscommand2( "GetTimeZoneOffset", "timezone_offset" ); trace( "Timezone offset: " add timezone_offset ); // outputs: Timezone offset: -60 GetDeviceID The GetDeviceID command returns the unique identifier of the mobile device (i.e., the IMEI number of the device in the specified variable). The command can sometimes cause a pop-up dialog on the mobile device as a security measure. Support Flash Lite 1.1; Flash Lite 2.X Example of usage status = fscommand2( "GetDeviceID", "device_id" ); trace( "Unique DeviceID: " add device_id ); // outputs: Unique DeviceID: 1234-5678-9012-345 GetDevice The GetDevice command returns the

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    70 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us