|
|
ChooseIt
It acts like an image map. You put buttons on it and when a user clicks
it, they are sent to a specified url. What is special is that the
buttons "fly" off the page and you can play a sound. All of the buttons
have two images. One is the off image and one is the "on" image. The
"on" image appears when the mouse is over it.
Here are the possible parameters:
<applet code=ChooseIt.class width=460 height=230>
<param name=numbuttons value=2>
<param name=butwidth value=70>
<param name=butheight value=35>
<param name=flypressedonly value=1>
<param name=backimg value=back.jpg>
<param name=x0 value=220>
<param name=y0 value=30>
<param name=buttoninfo0
value="techtip.gif,techtipg.gif,techtips.htm,Technical
info,sounds/boo.au">
<param name=x1 value=300>
<param name=y1 value=30>
<param name=buttoninfo1
value="software.gif,softwareg.gif,software.htm,
Download free software!">
</applet>
What they mean:
numbuttons - number of buttons butwidth - width of a button in pixels butheight - height of a button in pixels flypressedonly - 1=only the selected button "flies" off the screen 0=all buttons "fly" backimg - background image, if none used applet just draws stars x# - x position of button #,button numbers begin at 0 y# - y position of button #,button numbers begin at 0 buttoninfo# - contains a comma delimited string of button #'s info 1. .gif/.jpg of button # in non-selected state 2. .gif/.jpg of button # in selected state 3. url to go to when button # pressed 4. status line message 5. a sound (au) to play when button # pressed (optional) ex: "imgoff.gif,imgon.gif,apage.htm,Go to the page,ding.au"
In this example, I have two buttons. The first one will play a sound
but the second one will not. Also note that "butwidth" and "butheight"
refer ALL of the buttons so therefore they must all be the same size.
Watch out: the button numbers start at 0!
Hint:
Your .au sounds
must be 8-bit,mono at 8000Khz. See playau
for details.
Now includes the source code!
Download chooseit.zip
(contains ChooseIt.class,ChooseIt.java)
|