showPopup is blocking, which means that the Neko script
will halt until an option is selected by the user. If an option is selected, then an integer value representing
that option is returned; otherwise, should the user click elsewhere outside of the visible menu, then zero
is returned. You can make a call to showPopup without waiting for a message to be sent by Windows.
Simply make the call to showPopup and the associated menu will appear wherever the mouse cursor is
located. This is great for assigning native menus to individual elements of a running Flash movie.
(continued)
Chapter 18: Desktop Flash with SWHX
529
showPopup isn ??™ t necessary for menus assigned to the top of the window, as it handles itself, until an
option is selected, at which point its reference value is returned to the Neko callback.
So, what about creating the menu objects? Well, as with the tray icons, you must first create a static
variable container for the menu. Once this is done, you must initialize the variable by passing it a new
instance of the Menus class:
var menu : Menus = new systools.
Pages:
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983