Home -> VRSmarty plugins page -> spotmenu.swf
This plugin is completely free for use in any context or connection.
spotmenu.swf
VRSmarty plugin for displaying a scrollable menu box.
Each menu item can have an icon and OnClick, OnOver and OnOut events.
Menu can be set as draggable
You can have as many menus as you like in your pano.

The following parameters are supported:

In VRSmarty xml file:
xmlFilexmlFile='myMenu.xml'plugin control XML file, default=spotmenu.xml



Plugin attributes:set with spot_id.content.name=value
xmlFilexmlFile='myNewMenu.xml'new XML file will rebuild menu


Plugin methods: call with spot_id.content.name(value)
setOnClick('id','cmd')setOnClick('item3','goPano8')assign new onClick command to menu item
click('id')click('item7')simulate menu item being clicked
select('id')select('item2')make menu item selected
unselect()unselect()unselect any selected menu item
disable('id')disable('item2')Set menu item as disabled (not selectable)
enable('id')enable('item1')Set menu item as enabled (selectable)



Plugin external xml file:

In <spotmenu> tag:
sizesize="124:500"menu size, if not given menu will be autosized
bgColorbgColor="#CFCFC0"menu background color, default=no background
bgImagebgImage="img/menubg5.jpg"menu background image
borderColorborderColor="#000000"menu border color, default=no border
titletitle="My VRSmarty menu"menu title, default=no title
itemSpaceitemSpace="5"extra vertical space between menu items, default=0
selectModeselectMode="3"menu item behaviour after being clicked: (see NOTES below)
1 = selected and not clickable (default)
2 = selected and clickable
3 = not selected and clickable
draggabledraggable="1"makes menu draggable (requires menu title)



In <menuItems><item> childtag:
idid="p12"image id (optional), used as reference when using
the "click" or "select" parameters
texttext="Train Station"menu item text
text="-" will generate a menu separator
imageimage="img/train.png"menu item icon image
addSpaceaddSpace="20"additional space before menu item, default=0
onClickonClick="global.goPano2"menu item onClick command
onOveronOver="pic3.visible=1"menu item onOver command
onOutonOut="pic3.visible=0"menu item onOut command
selectedselected="1"menu item selected at start, default=0
enabledenabled="0"menu item enabled/disabled at start, default=1
headingheading="1"makes this item a heading, default=0
subheadingsubheading="1"makes this item a subheading, default=0



Use the <fonts> tag with its childtags to set the visual attributes for the menu:
In <fonts> tag:
<title> childtagmenu title attributes
<heading> childtagmenu heading attributes
<subheading> childtagmenu subheading attributes
<item> childtagmenu item attributes
<selected> childtagselected menu item attributes
<mouseOver> childtagmouse-over menu item attributes
<disabled> childtagdisabled menu item attributes

Each of the childtags above supports the following attributes:
fontfont="Helvetica"text font name
textSizetextSize="16"text size
textColortextColor="#FFFFFF"text color
boldbold="1"text bold attribute
italicitalic="1"text italic attribute
underlineunderline="1"text underline attribute
bgColorbgColor="#F00000"background color
borderColorborderColor="#A0A0C0"border color



NOTES:

If a background image is larger than the menu, it will be automatically masked.

The selectMode="n" attribute controls what happens with a menu item after it has been clicked. If you want it to be selected and not clickable again, use selectMode="1" which is default. If you want it to be selected but clickable again use selectMode="2". And if you want it to be not selected and of course clickable again, use selectMode="3".

The "click('xxx') method can be used at any time to simulate a menu item click. The onClick command will be executed.

The "select('xxx') method can also be used to select a menu item. But the onClick command will NOT be executed.

If the "id" attribute has not been specified for menu items, the parameter in the "click" and "select" commands will be matched against the menu item "text" attribute.

Heading/subheading items that has got the onClick attribute specified will be clickable as shown by the hand-cursor at mouse-over.

Example menu <spot>:

<!-- plugin hotspots -->
<spot id="menu2" url="spotmenu.swf" layerType="pano" type="static" staticAlign="RC" align="RC"
   staticX="10" staticY="80" mouseChildren="true" blockMouse="true"
   xmlFile="menu22.xml"
/>
					



Example plugin xml file:

<?xml version = '1.0'?>
<spotmenu
   size="200:250"
   bgColor="#FFFFFF"
   borderColor="#000000"
   title="My menu 2"
   itemSpace="2"
   selectMode="2"
>
   <fonts>
      <title font="Helvetica" textSize="16" textColor="#FFFFFF" bgColor="#0000F0" bold="1" />
      <item font="Helvetica" textSize="14" textColor="#000000" />
      <selected textColor="#FFFFFF" bgColor="#333333"  />
      <mouseOver bgColor="#F8F8FF" borderColor="#A0A0C0" bold="1" />
      <disabled textColor="#A0A0A0" italic="1" />
   </fonts>
   <menuItems>
      <item id="M1" text="City Hall Tower" image="img/camera2.png" onClick="showFake()" />
      <item id="M2" text="Maria Hill" image="img/camera1.png" onClick="showFake()" />
      <item text="-" />
      <item id="M3" text="%C5SS bridge" image="img/yacht2.png" onClick="showFake()" />
      <item id="M4" text="Where I work" image="img/work.png" onClick="showFake()" enabled="0" />
      <item id="M5" text="The Train Bridge" image="img/train.png" onClick="showFake()" selected="1" />
      <item text="-" />
      <item id="M6" text="My home" image="img/home.png" onClick="showFake()" />
      <item id="M7" text="The Yacht Club" image="img/yacht.png" onClick="showFake()" />
      <item text="-" />
      <item id="M8" text="City Hall Tower" image="img/camera2.png" onClick="showFake()" />
      <item id="M9" text="%C5SS bridge" image="img/yacht2.png" onClick="showFake()" />
      <item id="M10" text="Where I work" image="img/work.png" onClick="showFake()" />
      <item text="-" />
      <item id="M11" text="My home" image="img/home.png" onClick="showFake()" />
      <item id="M12" text="The Yacht Club" image="img/yacht.png" onClick="showFake()" />
   </menuItems>
</spotmenu>
					


Version history: