Shokwave Software, Inc. -      Web Deco Kit

The Flasher Applet

Description

The Flasher applet puts a text message in a box with a background color and font that you specify and animates it between two colors that you supply. You also supply a number of in-between colors you want to use and the speed that transitions take place. By varying the parameters, you can create a variety of effects. You may optionally supply a URL that the applet will tell the browser to load when clicked. Size: about 3,800 bytes

Examples

(for each example on the left, the HTML that generated it is on the right)
Sorry, your browser does not support Java, so you can't see applet in action.

By only specifying only one step and making one of the colors the same as the background color, you get a blinking message. Note that moving the cursor over the flashing message shows a URL in your browser's status line. Clicking the flashing message will take you to that URL. Caution: blinking text is very annoying, use it with discretion.


<P ALIGN=center>
<APPLET CODE="Flasher.class" CODEBASE="Java" 
     WIDTH=100 HEIGHT=40 ALIGN=middle>
<PARAM NAME=Text VALUE="Blinking!">
<PARAM NAME=TextFont VALUE=Times>
<PARAM NAME=TextSize VALUE=24>
<PARAM NAME=TextFace VALUE=0>
<PARAM NAME=TextColor1 VALUE=255,255,255>
<PARAM NAME=TextColor2 VALUE=255,0,0>
<PARAM NAME=Steps VALUE=1>
<PARAM NAME=Delay VALUE=100>
<PARAM NAME=Background VALUE=255,255,255>
<PARAM NAME=XPos VALUE=20>
<PARAM NAME=YPos VALUE=32>
<PARAM NAME=GoTo VALUE="http://www.anyURL.com">
Sorry, your browser does <B>not</B> support 
     Java, so you can't see applet in action.
</APPLET>
</P>
Sorry, your browser does not support Java, so you can't see applet in action.

If you specify two different colors and a number of steps, the applet will morph between them, an effect that is a lot more pleasant than blinking text. Note that the size and style of text are different from the previous example.


<APPLET CODE="Flasher.class" CODEBASE="Java" 
     WIDTH=100 HEIGHT=22 ALIGN=middle>
<PARAM NAME=Text VALUE="Morphing!">
<PARAM NAME=TextFont VALUE="Times">
<PARAM NAME=TextSize VALUE=18>
<PARAM NAME=TextFace VALUE=1>
<PARAM NAME=TextColor1 VALUE=0,0,255>
<PARAM NAME=TextColor2 VALUE=255,0,0>
<PARAM NAME=Steps VALUE=6>
<PARAM NAME=Delay VALUE=100>
<PARAM NAME=Background VALUE=255,255,255>
<PARAM NAME=XPos VALUE=5>
<PARAM NAME=YPos VALUE=18>
<PARAM NAME=GoTo VALUE="http://www.anyURL.com">
Sorry, your browser does <B>not</B> support 
     Java, so you can't see applet in action.
</APPLET>

Sorry, your browser does not support Java, so you can't see applet in action.

If you specify a background color that doesn't match the one on your page, you set off the text in the applet even more. By making the Delay parameter large, you slow down the transitions between colors. Note that the usual alignment tags work with applets (this applet is inside of paragraph tags with align=right). Also, notice that the XPos and YPos paramters were used to put the text at the right spot within the applet's space.


<APPLET CODE="Flasher.class" CODEBASE="Java" 
     WIDTH=100 HEIGHT=42 ALIGN=middle>
<PARAM NAME=Text VALUE="Big!">
<PARAM NAME=TextFont VALUE="Helvetica">
<PARAM NAME=TextSize VALUE=36>
<PARAM NAME=TextFace VALUE=0>
<PARAM NAME=TextColor1 VALUE=0,0,255>
<PARAM NAME=TextColor2 VALUE=0,255,0>
<PARAM NAME=Steps VALUE=4>
<PARAM NAME=Delay VALUE=1000>
<PARAM NAME=Background VALUE=128,128,128>
<PARAM NAME=XPos VALUE=20>
<PARAM NAME=YPos VALUE=32>
<PARAM NAME=GoTo VALUE="http://www.anyURL.com">
Sorry, your browser does <B>not</B> support 
     Java, so you can't see applet in action.
</APPLET>

Parameters

The Flasher applet takes the following parameters:

TextThe message to be displayedRequired
TextFontName of the font for the messageOptional
TextSizeSize (points) for messageOptional
TextFace0-Plain, 1-Bold, 2-ItalicOptional
TextColor1First R,G,B of messageOptional
TextColor2Second R,G,B of messageOptional
StepsNumber of steps between first and second colorOptional
DelayMilliseconds between changesOptional
BackgroundR,G,B of backgroundOptional
XPosX position of start of textOptional
YPosY position of start of textOptinoal
GoToURL to Goto when applet is clickedOptional
Outside of PARM tagsHTML for those with non-Java browsersOptional



Web Deco Kit Page     Shokwave Home Page