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. Just go and download my test application from Mosh[1] and try the "Vibrate" button ;o)
Contents |
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.
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.
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...
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)
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.";
}
else{
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 comment on this article on the Comment tab ;o)
No related wiki articles found