Why on Earth does AlphaMania have popup menu functionality?
AlphaMania's SetFX interface was created as a Director movie, but the
design called for a professional quality platform-native popup menu, which
Director does not support. In order to achieve this design goal Media Lab added
lingo-callable basic popup menu functionality to AlphaMania for Mac OS Classic,
Mac OS X, and Windows. The popup menu does not support submenus or styles,
but for basic one-level menu needs it is perfect, and very easy to use. We
have decided
to document this feature as an added bonus for our customers.
How do you use it?
Implementation is a single function, PopupMenu(). It is called with a lingo
list of menu items and a location, and returns the item number (starting
with one) the user chose,
or
zero if
no item was selected. Generally you will call PopupMenu from within a mouseDown
handler.
Because the menu is created through the AlphaMania Xtra, at least one AlphaMania member must be present in the cast, even if it never appears on stage, to be used for calling the function
Here is the basic call syntax:
old style:
chosenItem = PopUpMenu( amMember, loc, menuList)
new style:
chosenItem = (member amMember).PopUpMenu(loc, menuList)
chosenItem: the function returns an integer representing the number of the
item chosen. Zero signifies the menu was closed without a selection made.
amMember: a member reference for any castmember imported by AlphaMania. Note,
this is a reference as in "member 4" rather than a number.
loc: a point structure indicating the location of the menu.
menuList: a Lingo list of strings representing the menu item names.
Here is lingo for a small menu demonstration:
global myMenuList = ["Medium",
"Large", "Extra Large", "Super Size", "Biggie Size"]
global anAM_MemberNum = 2 -- any AlphaMania member
on mousedown
set choice =
PopUpMenu(member anAM_MemberNum, the mouseloc, myMenuList)
if choice = 0 then
put "No selection made."
else
put "Selected item number:" && choice
put "The list item selected was:" && getAt(myMenuList,
choice)
end if
end
Here is an example (requires Shockwave and AlphaMania auto-download):