Page 250 - DCAP303_MULTIMEDIA_SYSTEMS
P. 250
Multimedia Systems
notes You can even change the audio file at play time:
<a href=”javascript:doPlay(‘success.wav’)”>doPlay(‘success.wav’)</a>
doPlay(‘success.wav’)
To reduce the risk of sound injury, adjust the volume before putting on
headphones, earbuds, or a headset.
Select a sound clip and upload on the Web.
14.5 animation
14.5.1 animation with Javascript
Animation on Websites is controversial because the quality is often uneven. Well-done animation
adds excitement and interest to a Web page, but bad animation distracts viewers and increases
download times. You want to use animation to provide a sense of movement to the page––without
inducing motion sickness in your visitors.
You can use some simple JavaScript techniques to include user-controlled animation that adds
action without annoying visitors. The examples in this will show you how to include an animated
GIF in your JavaScript code and also how to create a simple animation effect using a JavaScript
rollover.
14.5.2 Carefully select the Best format
When you decide to include animation on your Website, you are constrained by two main factors:
your ability and your audience’s browser limitations. For instance, Java applets require that you
have at least some basic Java programming ability. Shockwave and Flash effects must be created
using Macromedia’s tool sets and both require that your visitors have the plug-ins installed to
view them.
JavaScript is easier to learn and more widely available to users. There are many ways to create
animation effects with JavaScript: rollovers and cycling banners are the easiest, but you can also
use more complex coding to create animated DHTML effects. Be careful with those because they
will only work in Explorer and Netscape versions 4.0 and up.
The GIF is the most widely supported format since everyone using a graphical browser has the
capability to view GIF images. In an animated GIF file, several GIF89 images are stored in a
single file and then played in sequence. The image file is downloaded once and replayed from the
computer’s disk cache. Many software packages are available that help you to create animated
GIFs (from images in the GIF89 format) and control their display.
Animated GIFs are so easy to create that novices often get carried away and create huge files that
take forever to download. All the image optimization rules for regular GIFs still apply to animated
ones. Speed up your file by optimizing each image with NetMechanic’s free GIFBot tool before
you combine them into a single file.
14.5.3 User Control over animated Gifs
One of the most common complaints about animation is that the constant movement annoys
visitors and detracts from the page’s content. This is a valid argument; who has not been driven
from at least one Website by an annoying animated graphic that repeats endlessly?
244 LoveLy professionaL University