Channels ▼


Flash Lite: Graphics for Mobile Devices

Source Code Accompanies This Article. Download It Now.

Which Flash Lite Version to Target?

There are a number of different versions of Flash Lite. The most widely deployed version on handsets is Flash Lite 1.1. However, Flash Lite 2.x players have started popping up on some handsets. Table 1 lists the differences between Flash Lite 1.1 and 2.

  Flash Lite 1.1 Flash Lite 2
Based on Flash 4 (ActionScript pre-1.0) Flash 7 (ActionScript 2.0)
Support for device video No Yes
Support for data download Yes (text, value-name pairs only) Yes (XML and name-value pairs)
Support for image download Yes (inside a swf-file only) Yes
Support for saving data on the device No Yes
Support for arrays No (workaround available) Yes
Application types Standalone, wallpaper, screen savers (depending on the device) Standalone, wallpaper, screen savers (depending on the device)

Table 1: Flash Lite 1.1 versus 2.

Flash Lite players running on mobile devices are backward compatible: A Flash Lite 2 player can execute Flash Lite 1.1 animations, but not vice versa. Hence, if you want to address the biggest potential market, you have to use Flash Lite 1 as the development target. Unfortunately, Flash Lite 1.1 is based on older technology, which is missing key features for effective application development. This means that, for some applications, it is better to go with Flash Lite 2.

A big difference is support for external data downloading. XML support is only available for Flash Lite 2 applications. The only way to retrieve text data from a server in Flash Lite 1.1 is to use name-value pairs. If you cannot transcode your structured data to simple flat file, you might need to use Flash Lite 2.

But using name-value pairs isn't that bad. For instance, fewer bytes are transmitted via name-value pairs than with, say, XML formats that add extra bytes in messages. Since users in some countries pay for each byte transmitted over the network, it is a good idea to limit the amount of transmitted data.

Another difference between Flash Lite 1.1 and 2 is support for array data objects. Flash Lite 1.1 is based on Flash 4. Since there is no support for arrays in Flash 4, Flash Lite 1.1 does not support arrays either. Arrays are supported on Flash Lite 2.

However, you can emulate arrays in Flash Lite 1.1 using the eval() function, which takes a name of a variable as a parameter and returns the contents of that variable. For example, if the variables name1,name2, ..., name10 contain names of baseball players, Listing One displays the names of the players.

for (i=1; i<=10; i++) {
    playerName = eval("name" add i);
Listing One

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.