Click to See Complete Forum and Search --> : Using a FORM to change A PARAM VALUE inside an Applet


Lucien
09-04-2003, 07:56 PM
With the use of a FORM (Columns="Any Number", Rows="Any Number") , I want to be able to change from the HTML screen the following PARAM values:

<PARAM NAME="hnum" VALUE="4"><PARAM NAME="vnum" VALUE="4">

These PARAMS control the number of COLUMNS ("hnum") and ROWS ("vnum") for a Slide Puzzle—[A Free JavaScript at http://javaboutique.internet.com/slidepuzzle]

They are inside the

<APPLET CODE="SlidePuzzle.class" WIDTH="550" HEIGHT="400" ALIGN="MIDDLE">
<PARAM NAME="image" VALUE="mypic.jpg">
<PARAM NAME="hnum" VALUE="4">
<PARAM NAME="vnum" VALUE="4">
<PARAM NAME="backgroundcolor" VALUE="006600">
<PARAM NAME="soundfile" VALUE="default.au">
<PARAM NAME="pieceshaveborders" VALUE="true">
<PARAM NAME="enablescrolling" VALUE="true">
<PARAM NAME="pieceshavebuttoneffect" VALUE="true">
<PARAM NAME="alwayssolvable" VALUE="true">
<PARAM NAME="scrollingtime" VALUE="300">
<PARAM NAME="solvethepuzzletext" VALUE="Solve it!">
<PARAM NAME="imagestillloadingtext" VALUE="Image is still loading...">
<PARAM NAME="userhaswontext" VALUE="You win!">
<PARAM NAME="timetext" VALUE="Time (seconds): ">
<PARAM NAME="movestext" VALUE="Move: ">
<PARAM NAME="scrambletext" VALUE="Scramble!">
The puzzle-applet: use a java browser
</APPLET>


Thanks in Advance,

Lucien

Khalid Ali
09-04-2003, 08:15 PM
I don't think that will work.Because param values are read by the applet at the load time.And if you change them after its loaded,I doubt that its going to do what you are expecting.

What you will need to is create some
setter methods in applet and then once you call those setter methods,redraw the applet with the new params.