CButton
Last Updated:
(Note: This version of CButton is buggy. Please
allow the author some time to fix them).
10/9/1996 - Added Cross-Frame Page opening capability
9/17/1996 - Added Functions available for Live-Connect
Price info of shareware version is available.
Running Applet is demonstrated below - Scroll to See!!
!! (See details below)
Running applets:
(It may take a while to load...)
(captionMode=3, action=SoundSwitch)
captionMode=0, soundmode=0
captionalign=center
(share)
|
|
speed=3, captionMode=1, soundmode=1
(share)
|
speed=5, captionMode=2, soundmode=2
fixCaption = Shareware is better!!
fixCaptionColor=vary, bgcolor=vary
(share)
|
|
speed=0, captionMode=2, soundmode=1
fixCaption=Warning!!
(share)
|
speed=5, captionMode=0, soundmode=0
upImage = "", borderWidth=0, borderHeight=0
fixCaption=Cool Web Zoo
fixCaptionColor=vary,fixCaptionBlink=1
(share)
|
|
speed=5, captionMode=0, soundmode=1
captionalign=center
borderWidth=5, borderHeight=5
numCaption = 0
|
speed=7, captionMode=1, soundmode=0
upImage = "", borderWidth=0, borderHeight=0
(share)
|
|
captionMode=3, soundmode=2
captionalign=center
borderWidth=0, borderHeight=0
numCaption = 0
|
: Applets work with Javascript!!
Description:
cbutton, Command Button, is a JAVA applet written
by Mark Qian. It works as a command button with pictures
and scrolling and muilt-line caption. It also provides sound
when mouse over or click. Its on_click parameter allows you
open a given URL address when clicking. In additional, it allows you display a
message in the status bar when mouse cursor move over the applet. Details
about how to install it in your page is available in below.
NOTE: Both Adware (FREE) and shareware (NOT FREE) versions are
available. The parameters marked with (share) are only
available in shareware version.
You can now use Adware version of CButton with full-feature during the period other than business hours.
That is, all the functions in the Adware are available at a period from 7:00PM - 7:00AM. You can use your own
parameters during that period. But during the period 7:00AM - 7:00PM, the caption and URL will be
replaced by author's infor and URL. If you like to use it as an Adware with limited parameters
instead of evaluate it's full-feature, you need to set parameter whatWare = Adware.
(The default of whatWare is evaluteShareware). If you like to have all these features available full-time,
you need to download the shareware version and register it to get the Registration Code to unzip the
shareware package. Price and registration infor of shareware is available.
!!!!!!!!! Be sure you try it with your own stuff during !!!!!!!!!!!
Note: You can also set the clock in your local machine to
a time between 7:00PM - 7:00AP so that you can test it any time.
:
********* You have to make sure the Adware version (FREE)
works fine in your server before you register the
shareware version because you are buying a Code.
That is, after you register the shareware (pay fee)
only thing you will recieve is a Code which can be
used to unzip the shareware package. The Code is
NOT refundable, NOT returnable, and NOT exchangable.
Don't register the shareware if you are NOT sure
- It REALLY WORK in your server
- You REALLY like to use the shareware.
Parameters:
target - target window where the target URL will be opened.
You can set it to a sub frame if you use frames so
that the URL is opened in the sub frame. You can
also set it to one of following
_top
Bowser will place URL page into top-level window of the browser
_parent
Bowser will place URL page into parent window of the widnow
where HTML resides
_self
Bowser will place URL page into the widnow where HTML resides
_blank
Bowser will place URL page into a new window
captionMode - The way caption is displayed:
0 - display a static (still) multi-line caption. Of course, you
can display only a single line caption by provide only one
caption text and set parameter, numcaption to 1.
Note: Multi-line is only available in shareware version (share).
1 - display a scrolling (moving) single-line caption horizontally. Caption1,
caption2, ..., captionN will be scrolled in the order of their
numbers. (share)
2 - display a scrolling (moving) single-line caption vertically. Caption1,
caption2, ..., captionN will be scrolled in the order of their
numbers. (share)
3 - display Caption1 originally and display caption2 after a click. Switch between
Caption1 and Caption2 when clicking.
whichBase - 0 the applet uses DocumentBase. That is, applet will search resouces from
the directory where HTML file resides
1 applet uses CodeBase. That is, applet will search resouces from
the directory where Java class files resides.
speed - the speed (in milli-second) of animation. Range of speed can be 0 - n,
where n can be a large number such as 5000. Note: 0 - 10 is a
special range Where scrolling speed will change dramatically.
soundmode - The way sound is played.
0 - Sound is played when mouse cusor over Animator
1 - Sound is played when clicking.
audiofile - The audio file that should reside in
the directory where the applet resides.
upImage - The image displayed when cbutton is not pressed.
downImage - The image displayed when cbutton is pressed.
numCaption - Number of caption text.
fixCaption - Display a static caption at the first row.
fixCaptionColor - Determinate the color of the static caption.
fixCaptionHeight - Height of static caption area.
fixCaptionBlink - Make the static caption blick.
caption1 - Caption text 1
caption2 - Caption text 2 (share)
...
captionN - Caption text N (share)
borderWidth - The bevelwidth of left and right edges(in pixel).Set to 0 if you don't
like to have a border.
borderHeight - The bevelwidth of top and bottom edges(in pixel)
fontHeight - The size of caption font(1-100).
fgcolor - Color of caption. You need to use the same code format like you use
in HTML script such as #ff00ff. You can also set fgcolor = "vary".
Value "vary" will give caption a random color periodically.
background - URL of the Image which is used to paint caption area's background.
This URL has to be a local one such as "/html/images/bbb.gif".
You can not use a URL that point to an address that is not in
the server where the applet resides. If parameter background
is valid, bgcolor will be ignored.
NOTE: Using an image as background will slow down the
scrolling speed dramatically. I may want to adjust the speed
to speed up the scrolling text. Or you can ignore parameter
background so that the applet use parameter bgcolor in order
to increase the srolling speed.
bgcolor - Color of caption background. This feature can be overrided by
parameter background(That is, if background presents, bgcolor
will not effect. You need to use the same code format like you use
in HTML script such as #ff00ff. You can also set fgcolor = "vary".
Value "vary" will give caption background a random color each time
the applet is called.
fixCaptionColor - Color of static caption. You need to use the same code format like you use
in HTML script such as #ff00ff. You can also set fgcolor = "vary".
Value "vary" will give static caption a random color periodically.
status_text - status text which will be displayed in the status.
Just set it to "" to disable it. (share)
action - determinate what to do when click
"URL" - open the URL specified by "on_click"
"SoundSwitch" - Turn Sound On or Off.(Note: This can only control those
sounds played by Mark's applets.
on_click - an URL address whose content will be opened by browser
when clicking at the applet. Just set it to "" to disable it.
You are welcome to your URL
to Mark's Page:
if you have any Mark's applet running in your page.
This is a great place to make your site popular:
most visitors of this site are webmasters who are in charge of adding links!!
Detail Instructions for installation:
1).
or
What if downloading fails using the button above?
In this case, Go to Author's FTP Page directly to download them there!
Please Send us a message if you encounter
difficulty with downloading so that we can solve the problem shortly.
2). Unzip cbutton.zip in a tmp directory, say c:\tmp, in your local machine
3). Run SETUP.BAT to rename class files. Because PKUNZIP will extract the
class file, cbutton.class, to cbutton.CLA, you have to RENAME
the class file, cbutton.CLA, to cbutton.class
and rename COMMON.CLA to common.class if you
like to rename them yourself instead of using SETUP.BAT.
Note: class names has to be lower case.
At this time, you should have following files in c:\tmp
cbutton.class
common.class
TEST_CB.HTM
AZ_SN_1.GIF
AZ_SN_3.GIF
IN_RV_1.GIF
IN_RV_2.GIF
WOLF.AU
SOUND15.AU
4). Open TEST_CB.HTM with your browser locally. If it works locally,
go to next step. Otherwise, go to step B) below.
5). Try TEST_CB.HTM online.
- place cbutton.class and common.class in your HTML directory, say public_html,
in your server. (FTP program may change cbutton.class to cbutton.cla. Rename class files as needed
and rename COMMON.CLA to common.class. Note: class names has to be lower case. ).
Be sure that you set the file format to BINARY when you FTP class files
while set file format to ASCII or TEXT when you FTP html files
- place TEST_CB.HTM and SOUND*.AU to public_html
- change access attributes of all the files above to readable using following
Unix commands
chmod 744 ~/public_html/cbutton.class
chmod 744 ~/public_html/common.class
chmod 744 ~/public_html/TEST_CB.HTM
chmod 744 ~/public_html/AZ_SN_*.GIF
chmod 744 ~/public_html/IN_RV_*.GIF
chmod 744 ~/public_html/WOLF.AU
chmod 744 ~/public_html/SOUND15.AU
- NOTE: File names are case sensitive if you are using an Unix server.
- Browse the TEST_CB.HTM in your server from your local machine remotely.
If it works, go to next step. Otherwise, go to step B) below.
6). Use your stuff in TEST_CB.HTM. Replace following part of TEST_CB.HTM
<param name=audiofile value="WOLF.AU">
<param name=upImage value="IN_MT_4.GIF">
<param name=downImage value="IN_MT_3.GIF">
<param name=caption1 value="Great View!">
<param name=caption2 value="Please EMail">
<param name=caption3 value="Mark Qian">
<param name=on_click value="/html/savers_p.htm">
<param name=status_text value="My message is here.">
with your stuff, say
<param name=audiofile value="YOURS.AU">
<param name=upImage value="YOURS1.GIF">
<param name=downImage value="YOURS2.GIF">
<param name=caption1 value="YOUR TEXT1">
<param name=caption2 value="YOUR TEXT2">
<param name=caption3 value="YOUR TEXT3">
<param name=on_click value="YOUR URL">
<param name=status_text value="YOUR TEXT4">
where
YOURS.AU - your audio file
YOURS1.GIF1 - your image file1
YOURS2.GIF2 - your image file2
YOUR TEXT1 - your caption 1
YOUR TEXT2 - your caption 2
YOUR TEXT3 - your caption 3
YOUR TEXT4 - your status bar text
YOUR URL - the URL you like to open when clicking
(You can place any number of caption text based on your need.
Note: don't forget to change parameter numcaption to match the
number of caption text).
If it works, go to next step. Otherwise, go to step B) below.
7). Insert the applet to your page, say YOURS.HTM. Copy-paste following part of TEST_CB.HTM
to the place you want in YOURS.HTM
<applet code="cbutton.class" width=150 height=120>
<param name=captionMode value="2">
<param name=speed value="5">
<param name=soundmode value="0">
<param name=fixCaptionColor value="vary">
<param name=fixCaption value="Cool Web Zoo">
<param name=fixCaptionBlink value="1">
<param name=fixCaptionHeight value="30">
<param name=audiofile value="YOURS.AU">
<param name=bgcolor value="#c0c0c0">
<param name=background value="/html/images/bbb.gif">
<param name=upImage value="">
<param name=downImage value="YOURS1.GIF1">
<param name=borderWidth value="YOURS1.GIF2">
<param name=borderHeight value="0">
<param name=fontHeight value="15">
<param name=numCaption value="1">
<param name=caption1 value="YOUR TEXT1">
<param name=textAreaHeight value="40">
<param name=fgcolor value="#f00000">
<param name=on_click value="/html/webz_p.htm">
<param name=status_text value="You can ignore upImage not to display the picture and captionMode=0 not to scroll.">
</applet>
Browse YOURS.HTM in your server.
If it works, go to next step. Otherwise, go to step B) below.
8). Place resource files to a sub-directory, say resource, using
following Unix commands:
mkdir ~/public_html/resource
chmod 755 ~/public_html/resource
mv ~/public_html/YOURS.AU ~/public_html/resource
mv ~/public_html/YOURS*.GIF ~/public_html/resource
Change the corresponding reference in YOURS.HTM to match your change:
<param name=sndsound1 value="resource/YOURS.AU">
<param name=sndsound2 value="resource/YOURS1.GIF">
<param name=sndsound3 value="resource/YOURS2.GIF">
Browse the page in your server.
You can use shareware such as PaintShop to edit your own gif images.
You may want to edit your own AU files using shareware like COOLEDIT.
Be sure that you try the minimum quality first: Mono, 8 bit, 8000Khz Sample rate. You can also
convert a MIDI file to AU using CSound in order to play it with this applet.
If it works, go to next step. Otherwise, go to step B) below.
9). Congraduation!! Do Mark a favor: let him know you did it!!
Enjoy it !! (Don't forget to BOOKMARK this page so that you can update it shortly:
Ad will be upgraded frequently).
B). Contact Mark Qian.
Please describe
- which step you have reached
- the errors you get in details(If you use Netscape, click at menu item
Option | Show Java Console and copy-paste-EMail the content there to Mark).
- If you have rearched step 5 or later, run following Unix commands to save
access attribute infor into a file, say tttt
cd ~/public_html
ls -l cbutton.class > tttt
ls -l common.class > tttt
ls -l WOLF.AU >> tttt
ls -l SOUND15.AU >> tttt
ls -l AZ_SN_*.GIF >> tttt
ls -l IN_RV_*.GIF >> tttt
ls -l TEST_CB.HTM >> tttt
Then, EMail file tttt to Mark Qian so that he can ensure if all the file attributes are setup OK.
To learn how to place a Java applet into your page,
please go to this page and select "How to Add Java Applet to Your Site"
at the bottom of the page.