Command Although Flash Lite 2.0 has come out soon, but it is necessary to master some of the basic knowledge of Flash Lite 1.1, for mobile phone flash application developers, wait until Flash Lite 2.0 is not the best choice, It is important to master the opportunity.
This information is actually from the Flash Lite 1.1 of the document translation, is to find in the future more convenient. These features are not supported by all mobile phones and need to be tested to see if they are supported.
Flash Lite 1.1 currently supports a relatively strong FSCommand2, which is not supported in a common flash player. Relative Fscommand, as the following differences:
- FSCommand2 can use any number of parameters;
- The FSCommand2 is executed immediately in the animation, while the Fscommand is executed after the end of the frame;
- FSCommand2 can have a return value in order to determine whether it is successful.
FSCommand2 mainly divided into three categories: general instructions, control the video playback instructions, platform-related directives. Here are the details:
General Instructions
Generic directive:: URL Encoding related
Escape
Status = FSCommand2 ("Escape", original, encoded)
URL encoding instruction that encodes original into encoded.
Return 0 failed, return 1 successful.
Example:
original_string = "Hello, how are you?";
Status = Fscommand2 ("Escape", original_string, "encoded_string");
Unescape
Status = FSCommand2 ("unescape", encoded, original)
URL decoding instructions, decoding the encoded into original.
Return 0 failed, return 1 successful.
Example:
string2 = "hello%7b%5bworld%5d%7d";
Status = Fscommand2 ("Unescape", string2, "normal_string");
General Instructions:: Input box related
Setinputtexttype ()
Status = FSCommand2 ("Setinputtexttype", VariableName, type)
Sets the type of text that the text box can enter, VariableName is the value in the corresponding text box, and type is controlled by the following content:
Numeric: [0-9];
Alpha: [A-Z, A-z];
Alphanumeric: [0-9, A-Z, A-z];
Latin: Latin symbol;
Nonlatin: non-Latin symbols;
Norestriction: Default mode.
Return 0 failed, return 1 successful.
Example:
Status = Fscommand2 ("Setinputtexttype", "Input1″", "Numeric");
Control instructions for movie playback
Instructions for controlling movie playback:: Displaying
Fullscreen ()
Status = FSCommand2 ("fullscreen", size)
Set the full screen playback mode, the size should be true or false.
Return-1 is not supported and 0 is supported.
Some phones do not support Full-screen playback mode.
Setquality ()
Status = FSCommand2 ("setquality", quality)
Sets the quality of the animation playback and the quality value is high,medium or low.
Return-1 is not supported and 0 is supported.
Instructions for controlling movie playback:: Keyboard settings
Setsoftkeys ()
Status = FSCommand2 ("Setsoftkeys", left, right)
Set the function of two soft keys on the phone to display content, left and right can be variables or strings. When the left button is pressed, the PageUp event is activated, and the right button is the PageDown event.
Return-1 is not supported and 0 is supported.
Resetsoftkeys ()
Status = FSCommand2 ("Resetsoftkeys")
Resets the left and right soft keys.
Return-1 is not supported and 0 is supported.
Player Action Instructions
Getfreeplayermemory ()
Status = FSCommand2 ("Getfreeplayermemory")
Gets the remaining amount of memory, in K.
Return-1 is not supported, the other value is the remaining memory, in K.
Gettotalplayermemory ()
Status = FSCommand2 ("Gettotalplayermemory")
Total memory available for Flash Lite, in K.
Return-1 is not supported, other values are memory, in K.
Launch ()
Status = Fscommand ("Launch", "Application-path,arg1,arg2,..., argn")
Perform other applications on the phone (OS independent).
Quit ()
Status = FSCommand2 ("Quit")
Exit the current Flash Lite program.
Return-1 is not supported.
Platform related directives
Platform related directives:: Date and time
Getdateday ()
Status = FSCommand2 ("Getdateday")
Get the current date (1-31).
Return-1 is not supported, and support returns the number between 1-31.
Getdatemonth ()
Status = FSCommand2 ("Getdatemonth")
Gets the current month (1-12).
Return-1 is not supported, and support returns the number between 1-12.
Getdateweekday ()
Status = FSCommand2 ("Getdateweekday")
Gets the current month (0-6).
Return-1 is not supported, and support returns the number between 0-6.
Getdateyear ()
Status = FSCommand2 ("Getdateyear")
Gets the current year.
Return-1 is not supported, support returns a number, such as: 2005.
Getlocalelongdate ()
Status = FSCommand2 ("Getlocalelongdate", "Longdate")
Gets the current long date string. The date format is determined by the phone itself and by the Locale. The date value points to a string.
Return-1 is not supported and 0 is supported.
The following are examples of two returned longdate:
October 16, 2004
2004 October
Getlocaleshortdate ()
Status = FSCommand2 ("Getlocaleshortdate", "ShortDate")
Gets the current short date string. The date format is determined by the phone itself and by the Locale. The date value points to a string.
Return-1 is not supported and 0 is supported.
The following are examples of two returned shortdate:
10/16/2004
16-10-2004
Getlocaletime ()
Status = FSCommand2 ("Getlocaltime", "Time")
Gets the current time string. The time format is determined by the phone itself and by the Locale. The time value points to a string.
Return-1 is not supported and 0 is supported.
The following are examples of two returned time:
6:10:44 PM
18:10:44
Gettimehours ()
Status = FSCommand2 ("gettimehours")
Get the current hour (0-23).
Return-1 is not supported, and support returns the number between 0-23.
Gettimeminutes ()
Status = FSCommand2 ("Gettimeminutes")
Gets the current minute (0-59).
Return-1 is not supported, and support returns the number between 0-59.
Gettimeseconds ()
Status = FSCommand2 ("Gettimeseconds")
Gets the current second (0-59).
Return-1 is not supported, and support returns the number between 0-59.
getTimezoneOffset ()
Status = FSCommand2 ("getTimezoneOffset", "Timezoneoffset")
Gets the current number of slack. The slack value points to a number in seconds.
Return-1 is not supported and 0 is supported.
The following are examples of two returned timezoneoffset:
540:japan Standard Time
-420:pacific Daylight Savings Time
Platform Related instruction:: volume
Getmaxvolumelevel ()
Status = FSCommand2 ("Getmaxvolumelevel")
Gets the maximum volume of the system.
Return-1 is not supported, and support returns a number.
GetVolumeLevel ()
Status = FSCommand2 ("GetVolumeLevel")
Gets the current volume of the system.
Return-1 is not supported, and support returns a number.
Platform related instructions:: Vibration
Startvibrate ()
Status = FSCommand2 ("Startvibrate", time_on, Time_off, repeat)
Set mobile phone vibration, time_on for start time, Time_off for stop time, repeat for repeat number. Time_on and Time_off are hundred minutes and no more than 5 seconds.
Return-1 is not supported, 0 is currently shaking, 1 is an error.
Stopvibrate ()
Status = FSCommand2 ("Stopvibrate")
Stop shaking.
Return-1 is not supported, 0 is stopped successfully.
Platform related instruction:: Power supply
Getbatterylevel ()
Status = FSCommand2 ("Getbatterylevel")
Get the electricity.
Return-1 is not supported, and support returns a number.
Getmaxbatterylevel ()
Status = FSCommand2 ("Getmaxbatterylevel")
Get the maximum amount of electricity.
Return-1 is not supported, and support returns a number.
Getpowersource ()
Status = FSCommand2 ("Getpowersource")
Obtain the power supply mode.
Return-1 is not supported, 0 is currently in use battery powered, 1 is currently powering on using an external power supply.
Platform related directives:: Network information
Getmaxsignallevel ()
Status = FSCommand2 ("Getmaxsignallevel")
Gets the maximum signal strength value.
Return-1 is not supported, and support returns a number.
Getnetworkconnectstatus ()
Status = FSCommand2 ("Getnetworkconnectstatus")
Gets the current network state.
Return-1 is not supported, others are
0: In the network connection state;
1: Trying to connect to the network;
2: No available network connection;
3: Network connection suspend state;
4: Unable to judge the state.
Getnetworkname ()
Status = FSCommand2 ("Getnetworkname", "NetworkName")
Gets the name of the connection network, and the return value points to a string.
Return-1 is not supported, others are
0: Not connected network;
1: Connect the network, but can not get the name;
2: Success.
Examples of NetworkName returned:
At&t Wireless
KPN Mobile
Getnetworkrequeststatus ()
Status = FSCommand2 ("Getnetworkrequeststatus")
Gets the status of the network request.
Return-1 is not supported, others are
0: Waiting, the network connection has been successful, the host name has been resolved, the server has been connected;
1: Waiting, the network connection has been successful;
2: Waiting, but the network connection has not been successful;
3: Waiting, the connection has been successful, the host name has been resolved;
4: Failure, network connection error;
5: Failed, connection server failed;
6: Server returns 404 error;
7: Failed, unable to connect to DNS server or unable to resolve host name;
8: The request completes successfully;
9: Request timeout;
10: The request has not been executed.
Getnetworkstatus ()
Status = FSCommand2 ("Getnetworkstatus")
Gets the network status.
Return-1 is not supported, others are
0: No network;
1: in the local network;
2: Expand the network locally;
3: Roaming.
Getsignallevel ()
Status = FSCommand2 ("Getsignallevel")
Gets the current signal strength value.
Return-1 is not supported, and support returns a number.
Platform related instruction:: User device information
GetLanguage ()
Status = FSCommand2 ("GetLanguage", "language")
Gets the language used by the user's device, and the return value points to a string.
Return-1 is not supported and 0 is supported.
Language value returned:
Cs:czech.
Da:danish.
De:german.
En-uk:uk or international 中文版.
En:usa 中文版.
Es:spanish.
Fi:finnish.
Fr:french.
Hu:hungarian.
It:italian.
Jp:japanese.
Ko:korean.
Nl:dutch.
No:norwegian.
Pl:polish.
Pt:portuguese.
Ru:russian.
Platform Integration Commands 45
Sv:swedish.
Tr:turkish.
Xu:the language cannot be determined.
Zh-cn:simplified Chinese.
Zh-tw:traditional Chinese.
Platform related instruction:: User device and player identification
Getdeviceid ()
Status = FSCommand2 ("Getdeviceid", "id")
Gets the ID of the device, and the return value points to a string.
Return-1 is not supported and 0 is supported.
GetPlatform ()
Status = FSCommand2 ("GetPlatform", "platform")
Gets the operating system platform of the device, and the return value points to a string.
Return-1 is not supported and 0 is supported.
The Paltform example returned:
506i
FOMA1
GetDevice ()
Status = FSCommand2 ("GetDevice", "Device")
Gets the model number of the device, and the return value points to a string.
Return-1 is not supported and 0 is supported.