Flash Lite [20] 2.0 Button event

April 5, 2006

In the Flash Lite 2.0, we have to use different way to access the button event.

First, if you need to use the softkeys, you have to write down the code as below to enable it.
fscommand2(“SetSoftKeys”, “Left”, “Right”);

Then we need a KeyLinstener:Object to access the button event and define the behavior.

var keyListener:Object = new Object();
keyListener.onKeyUp = function() {
if (Key.getCode() == ExtendedKey.SOFT1) {
//Left Softkey
} else if (Key.getCode() == ExtendedKey.SOFT2) {
//Right Softky
} else if (Key.getCode() == Key.LEFT) {
} else if (Key.getCode() == Key.RIGHT) {
} else if (Key.getCode() == Key.UP) {
} else if (Key.getCode() == Key.DOWN) {
} else if (Key.getCode() == Key.ENTER) {
}
};
Key.addListener(keyListener);

If you would like to define the numeric keys(0-9), you need to use the Key.getAscii() start from 48 to 57.
use 43 to define the “*”
use 35 to define the “#”

[ Notice ] Don’t use getCode() for numeric keys, because the keyCode of 3=# and 8=*.

Reference: Get Key Code(Execute in your mobile phone or emulator in Flash 8


Flash Lite [19] getURL( )

February 2, 2006

In Flash, we use getURL( ) to open a webpage or send a Email. It also works in the Flash Lite 1.1.

For the mobile phone, getURL( ) has more functions.

  1. make a call: getURL(“tel:0800080080″);
  2. send short message: getURL(“sms:0943434454″);
  3. send multimedia message: getURL(“mms:0943434454″);

If you would like to know more, you can refer to the official document.
Flash Lite 1.x ActionScript Language Reference.pdf (p20-22)


Flash Lite [18] Using sound

December 19, 2005

Currently, Flash not support using MIDI file directly.
This type is the smallest audio file, so it very familiar for the mobile device.
It only record the data, if your device support 40~64 audio track then it is as good as MP3 file.

If you use Macromedia Flash MX 2004 to create your Flash Lite content, you need a Flash Lite Bundler to let Flash Lite recognize the formats like MIDI, 3gp..supported by your device.

You can find the Flash Lite Bundler in Flash Lite 1.1 CDK.
Flash_Lite_authoring_updater/Flash Lite Bundler/FlashLiteBundler.exe

The way to use it is very simple, click the execute file and drag your MIDI file drop to below screen.


One type needs one file, let Flash Lite recognize the type not all files.

Press “Save Bundle” and save into the folder with your MIDI file. Before you using the MIDI file, you need to covert it to other type which supported by Flash, like mp3, wav. Then you can import these file to Flash.

After you import the audio files into Flash, open the Library and choose properties via options menu. Set the device sound in export settings.

Then you can use these sound like usual, just remember keep the file path when you put into your device. If the file exist and the path is correct, then you can play the sound from you device. It makes your content smaller and has more interaction with sound.


Flash Lite [17] Compare 1.1 with 2.0

October 10, 2005

Compare Flash Lite 1.1 with 2.0
[ Category ]
Item: 1.1/2.0

[ Sound Support ]
MIDI: Device dependent/Device dependent
PCM and ADPCM: Support/Support
MP3: Support/Support

[ Image & Video Support ]
PNG: During authoring/During authoring or device dependent
JPG: Support/Support
GIF: During authoring/During authoring or device dependent
Animation GIF: During authoring/During authoring
MPG-4 and other video formats: Not support/Device dependent

[ Multimedia Support ]
Dynamic loading of media files: Not support/ Support (JPEG and MP3, other formats dependent on the device-specific codes)

[ Text support ]
Character set: Latin-1 and Shift-JIS/UTF-8
Complex languages (Thai, Arabic, Hebrew, and so on) : Not support/Support
Text entry: Device dependent/Device dependent
Dynamic text: Support/Support
Device-specific vector fonts: Not support/Support
Improved small text readability: Not support/Support
Text measurement: Not support/Support
Text wrap: Not support/Support

[ Programming Features ]
ActionScript set: Flash 4 or earlier/Flash 7 or earlier
Dynamic loading of SWF data: Not support/Support
XML parsing: Not support/Support
String/Array/XML -to-native-objects conversion: Not support/Support
ActionScript strict mode: Not support/Support
Set/Clear interval: Not support/Support
Shape drawing API: Not support/Support
Ability to store data: Not support/Support

[ Interactivity ]
Keyboard events: Device dependent/Device dependent
Key-based navigation: Support/Support
Mouse/Stylus events: Device dependent/Device dependent

[ Other Features ]
Generic browser interface: Support/Support
Dynamic memory handling: Support/Support
Device-specific capability: Support/Support
Object model (for components): Not support/Support
Improved event model: Not support/Support
SWF file compression: Not support/Support
Dynamic discovery device features: Not support/Support
ActionScript exception handling: Not support/Support
New preloader API: Not support/Support
SVG-T1.1: Support/Support

[ Flash Lite Features ]
Access to device-specific features (volume, backlight, vibrate, and so on): Support/Support
Launch native applications: Support/Support
Reduced runtime memory consumption: Support/Support
Graceful handling out-of-memory condition: Support/Support
Interruptible/Re-entrant player: Support/Support
Runaway script limit: Support/Support
ActionScript slicing: Support/Support


Notes for online live seminar

September 29, 2005

Macromedia online live seminar-Tips for Optimizing Flash Lite Content
2005/09/28 9:00 PM US/Eastern

Three ways to optimizing graphics and animations
1. Simplifing animation
When you use tween shape, try to covert to the keyframes and remove the tween settings.

2.Use bmps in place of vectors
It will increase the memory if you use the vectors. So try to use bmp as possible.
Flash Lite [8] Bmp v.s. Vector

3.Adjusting the render quality
Use fscommand2(“SetQuality”, “low/high”) to adjust the render quality.
But you can’t test this function via emulation, you need to test it on your device.


Follow

Get every new post delivered to your Inbox.