contextmenu.swf
A lightweight right-click context menu popup that displays a dynamic list of labelled options. It appears wherever the game engine triggers a context menu (e.g. right-clicking world objects or players) and fires
OnOptionSelectedback to the game when the player picks an entry.
Document/main class: KiwiContextMenu (extends _kiwi.Core.UIComponent) — [Embed symbol "symbol11"]
SWF-specific classes: 3
Main class: KiwiContextMenu
Manages the root context-menu widget. On construction it registers two Iggy callbacks: updatedScreenSize and addItem. In non-Iggy (preview) mode configUI adds three hard-coded dummy items. The menu itself is rendered by the child OptionsContainer component.
Public methods
addItem(label:String, disabled:Boolean = false) : void— Appends one option row viamc_options_container.addOption("", label, disabled).clear() : void— Removes all option rows frommc_options_container.updatedScreenSize(w:int, h:int) : void— Clamps the menu'sroot.x/root.yso it stays inside the given screen bounds; called by the engine after the menu is positioned.
Key fields
items : Array— Unused remnant; actual item list is owned byOptionsContainer.mc_options_container : OptionsContainer— The child component that holds and renders all option rows.
Runtime dependencies & integration
IggyFunctions.inIggy— gate for registering Iggy callbacks.ExternalInterface.addCallback("updatedScreenSize", ...)/addCallback("addItem", ...).ExternalInterface.call("OnOptionSelected", index)— fired byOptionsContaineron click (unless anonItemSelectedoverride is set).
Other game-specific classes
Option(extendsMovieClip) — [Embed symbol4] — A single menu row; exposestextField(left column, used as label) andtextField2(right column, used as shortcut hint). Pure display symbol instantiated byOptionsContainer.OptionHighlight(extendsMovieClip) — [Embed symbol6] — The selection-highlight overlay; shown/hidden and repositioned byOptionsContaineras the pointer enters/leaves rows.
Notable logic (_kiwi.Controls.OptionsContainer)
OptionsContainer [Embed symbol7] is the framework class that drives all option logic:
- Adding options:
addOption(col1, col2, disabled)instantiates a newOption, stacks it below the previous one, wiresROLL_OVER/ROLL_OUT/CLICKmouse listeners, tracksoptionDisabled[], and growsheightto match. - Highlight: On
ROLL_OVER,selectedItemindex is set andInvalidationType.SELECTEDis raised;draw()repositionsmc_selection_highlightto the hovered row'sy + 2and recolors both text fields toColor_ItemEnabled_Highlight(0x555555). - Click: Calls
onItemSelected(index)function if set; otherwiseExternalInterface.call("OnOptionSelected", selectedItem). - Controller support:
onItemControllerEnter(i),onItemControllerLeave(i),onItemControllerClick(i)mirror the mouse events for gamepad/keyboard navigation. - Disabled items: Items passed with
disabled=trueare coloredColor_ItemEnabled_Disabled(0x888888) and cannot be selected. - Clear:
clearOptions()removes allOptionchildren, splices both tracking arrays, resetsselectedItem = -1, hides the highlight, and resetsheight = 10.