Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:Using Vibration to give user feedback in Flash Lite

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

We do not recommend Flash Lite development on current Nokia devices, and all Flash Lite articles on this wiki have been archived. Flash Lite has been removed from all Nokia Asha and recent Series 40 devices and has limited support on Symbian. Specific information for Nokia Belle is available in Flash Lite on Nokia Browser for Symbian. Specific information for OLD Series 40 and Symbian devices is available in the Flash Lite Developers Library.

Article Metadata
Created: Risalmin (03 Dec 2007)
Last edited: hamishwillee (14 May 2013)



In this article I will give some nifty examples on how to scare the user (at least the first time) with vibration feedback in Flash Lite. The reason why I say "scare" is, that the for some reason it is not commonly expected that a mobile phone wiggles in your hand.

Tactile feedback

When a device uses movement, vibration or similar to interact with a user, it is called tactile feedback. There is an article dicussing this topic in general, please see that for more general information about tactile feedback.

Where to use vibration


Think of a racing game, and the car goes off the track... It would enhance the experience, if the phone would vibrate in the hand. A lot like in most console games today! Also when you hit something or are hit in a FPS a short vibrations makes it feel a lot more real.

What if you had a character come up the screen and "tap it from the inside" and when the finger or hand touches the screen, the phone gives a small wiggle. Or when you see a missile coming at you and exploding on the screen, while the phone jumps like mad in your hands...

A longer, steady vibration would resemble an electric shock or perhaps the character on the screen is using an electric razor...

In some cases of course, the vibration can be used for moving the actual device. I can think of a game, where two phones were "racing" on slightly slanted surface using vibration bursts.

Practical implementations

Since we are working inside a mobile device with limited resource, you might not wish to use those resources for providing wait animations, but the user needs to know that pushing or clicking on an button has been registered. So why not make the device jerk ever so slightly. This way the user knows something is happening and you get precious seconds more before frustrations kicks in...

Don't get too excited though

In this, as well as in many other things, less is usually more. The sensation of "being real" does not last long if the phone constantly wiggles in your hand. Small bursts, ever so slightly applied, will keep the user from being drowned in sensory feedback. So remember that too much may be too much ;o)

ActionScript example

The following example will assume that you have button labeled "btnVibrate" and a dynamic textbox labeled "txt_Ouput" on your stage. When the user clicks btnVibrate, there will be eiher a series of three short vibrations or if vibration is not supported, there will be a text telling so.

btnVibrate.onPress = function(){
status = fscommand2("StartVibrate", 100, 250, 3);
if (status == 0){
txt_Output.text = "Vibration sequence of 100 milliseconds on, 250 milliseconds off, repeated three times.";
txt_Output.text = "Vibration function not supported in this device";

NOTE: In some Nokia devices you have to have vibration turned on the profile to be able to use vibration from Flash Lite, also in most cases the phone needs to have a SIM-card

Even having vibration turned on, some nokia devices does not support vibration from Flash Lite. Eg. Nokia 3230. You can read the Device profiles tab in Device Central for more information on the support for vibration.

Please give feedback

Please comment on this article on the Comment tab ;o)

This page was last modified on 14 May 2013, at 06:27.
46 page views in the last 30 days.