next up previous contents
Next: Encryption Up: Events Previous: onCommand   Contents


onUpdateItem

Description

Fires when a menu item is about to appear. You can handle this event to change the state of the menu item. Not available for Screen savers.


Syntax

Menu.onUpdateItem = function (identifier, state)
{
    // do something
}
SWFKit transfers the identifier of the menu item to the event handler. The state parameter is an object contains three write-only properties
enable
Boolean. If you set it to false in the event handler, the menu item will be disabled.
check
Boolean. If you set it to true in the event handler, the menu item will be checked.
caption
String. You can change the caption of the menu item by setting this property.


Examples

Menu.onUpdateItem = function (id, state)
{
    switch (id)
    {
    case "id0":
        // disable the menu item
        state.enable = false;
        break;
    }
}




Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.