The main goal of this example is to show how to use the InterWidgetCommunication method fileNumber(). This example uses a list (List1) and a function button (Btn1). List1 contains the names of different html pages, and Btn1 launches to the page selected in the list box. This example has the exact same functionality as the setValue() example. The method to perform the task is completely different, though. Here is a snapshot of what the html page looks like in a "WYSIWYG" tool:

Figure 1.
When an html name is selected from List1, the intrinsic value of that selection is sent to InternalRAM.word(0), (which is the Amulet Internal RAM, word variable 0) using the setValue() method. When Btn1 is hit, it uses the function Amulet:fileNumber(internalRAM.word(0)) function, which launches directly to the internal page number specified by the Internal RAM word variable #0.
The internal page numbers are determined by looking at the CompileMe.map link map file. Looking at CompileMe.map, you will see that Page1.html has a flash index of 0x22, Page2.html's is 0x23 and Page3.html's is 0x24. Notice in List1 below, that under options, the intrinsic values of the list entries are the same as the internal page numbers as found in CompileMe.map.
List1 holds the names of the pages to launch and invokes the setValue() method of InternalRAM.word(0) when "hit", with the intrinsic value of the list item selected as the argument. The value of Internal RAM word variable #0 is also used to set the initial condition of the list box. To accommodate the initialization of this variable, the include file, fileNumber.ini was used in an initInternalRAM Meta Tag. To create List1, use the following :
<APPLET CODE="List.class" WIDTH="58" HEIGHT="57" NAME="List1">
<PARAM NAME="href" VALUE="Amulet:InternalRAM.word(0).setValue()">
<PARAM NAME="fontSize" VALUE="2">
<PARAM NAME="fontStyle" VALUE="PLAIN">
<PARAM NAME="options" VALUE="page 1=0x22,page 2=0x23,page 3=0x24">
<PARAM NAME="initialCondition" VALUE="fromInitHref">
<PARAM NAME="initHref" VALUE="Amulet:internalRAM.word(0).value()">
< /APPLET>
To create Btn1, use the following:
<APPLET CODE="FunctionButton.class" WIDTH="150" HEIGHT="25" NAME="Btn1">
<PARAM NAME="href" VALUE="Amulet:fileNumber(internalRAM.word(0))">
<PARAM NAME="fontSize" VALUE="2">
<PARAM NAME="fontStyle" VALUE="plain">
<PARAM NAME="label" VALUE="go to selected page">
<PARAM NAME="onButtonPress" VALUE="invert">
< /APPLET>
A group of META REFRESH objects need to be included in the main page just so the HTMLCompiler knows to include these files into the project. These META Refresh Tags are never launched, but the HTMLCompiler will still include the files in the project. To create the three META REFRESH tags, use the following:
<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=page1.html">
<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=page2.html">
<META HTTP-EQUIV="REFRESH" CONTENT="0;HREF=URL=page3.html">
NOTES: