How to use Contextual Menu in Chrome Lib?

Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default How to use Contextual Menu in Chrome Lib?

    How to use Contextual Menu in Chrome Lib? I really want to make the menu in 3D scenes. Or I can use something else?

    THank you,
    LiM


    LiM the Manop webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. How add an option to the mouse contextual menu
      How can add an option to the mouse contextual menu. I need additional options for commenting pdf Thank
    2. Contextual Menu tutorial?
      Originally posted by: Newsgroup User You have to add items to Configuration/Menus.xml located in the users folder. You'll need to find the proper...
    3. Losing Cursor on Contextual Menu - Bug?
      I've noticed that I lose the cursor when I right-click to access the contextual menu, if I have a large amount of text selected at the time. I can...
    4. Illustrator 10 contextual menu error
      Woops, sorry. Have you checked for corrupt fonts? Try turning off your Antivirus software?
    5. Contextual menu sloooooooow...
      Gang, I'm using 10.2.6. A couple of times, I've been cleaning out the cache folder that Eudora seems to have put no size limit on by default. I...
  3. #2

    Default Re: How to use Contextual Menu in Chrome Lib?

    Hi,

    Sorry for the loooooonnnnnnnnnnnnng delay.

    Here is a series of handlers you must copy and paste in a movie script.
    Here, I show you how to create the contextual menu of an asian restaurant in
    a 3D town. When you click on models whose name begin with Restaurant or
    Dragon , the contextual menu appears.

    Cheers,
    Karl.



    on startMovie
    initMenus()
    end


    on initMenus


    3DMember = member("scene")
    3DSprite = sprite(1)
    arrowBitmap = member("arrow")
    arrowBitmapRollOver = member("arrow_rollover")
    MenuFont = "Arial"
    MenuFontSize = 14
    activeModelsPrefix = ["Restaurant", "Dragon"]


    -- Menu Class

    MenuClass = new(script "MenuClass")


    -- Order submenu

    mi1 = new(script "MenuItem", 3DMember, 3DSprite, "Sushi", #sushi,\
    "Toshiro Mifune's favorite", MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0,
    42, 0, true, false, false, 0,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi2 = new(script "MenuItem", 3DMember, 3DSprite, "Sashimi", #sashimi,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0, 42, 0, true, false,
    false, 1,\
    arrowBitmap, arrowBitmapRollOver, false)

    mi3 = new(script "MenuItem", 3DMember, 3DSprite, "Raw fish", #rawFish,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0, 42, 0, true, false,
    false, 2,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi4 = new(script "MenuItem", 3DMember, 3DSprite, "Chop Suey", #chopSuey,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0, 42, 0, true, false,
    false, 3,\
    arrowBitmap, arrowBitmapRollOver, false)

    myMenuItems = [mi1, mi2, mi3, mi4]

    OrderSubmenu = new(script "ContextualMenu", MenuClass, activeModels, true,
    "Order",\
    myMenuItems, 3DSprite.member, 3DSprite, 192, 128, 222, 70, CamSource)


    -- Main menu

    mi1 = new(script "MenuItem", 3DMember, 3DSprite, "Contact us",
    #contactUs,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 0,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi2 = new(script "MenuItem", 3DMember, 3DSprite, "Order Meals",
    OrderSubmenu,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 1,\
    arrowBitmap, arrowBitmapRollOver, false)

    mi3 = new(script "MenuItem", 3DMember, 3DSprite, "Our Employees",
    #ourEmployees,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 2,\
    arrowBitmap, arrowBitmapRollOver, false)

    mi4 = new(script "MenuItem", 3DMember, 3DSprite, "History", #history,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 3,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi5 = new(script "MenuItem", 3DMember, 3DSprite, "Prize won", #prizeWon,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 4,\
    arrowBitmap, arrowBitmapRollOver, false)

    myMenuItems = [mi1, mi2, mi3, mi4, mi5] -- you can add #separator to add a
    line between two menu items

    PlayerContextMenu = new(script "ContextualMenu", MenuClass, activeModels,
    false, "Viet Hung",\
    myMenuItems, 3DSprite.member, 3DSprite, 128, 128, 128, 70, CamSource)


    end


    -- Callback handler for menu item actions

    on handlerCallback mHandlerID, mParam1, mParam2, mParam3, mParam4

    if gGbl.pDebug then put mHandlerID && "called on" && mParam1


    case mHandlerID of

    -- MenuItem calls

    #sushi : orderSushi(mParam1)
    #sashimi : orderSashimi()
    #rawFish : orderRawFish()
    #chopSuey : orderChopSuey()
    #contactUs
    #ourEmployees
    #history
    #prizeWon

    end case

    end


    on orderSushi mParam
    put mParam1
    end orderSushi


    on orderSashimi
    end orderSashimi


    on orderRawFish
    end orderRawFish


    on orderChopSuey
    end orderChopSuey

    on contactUs
    end

    on ourEmployees
    end

    on history
    end

    on prizeWon
    end









    Karl Sigiscar Guest

  4. #3

    Default Re: How to use Contextual Menu in Chrome Lib?

    Hi,

    Sorry for the loooooonnnnnnnnnnnnng delay.

    Here is a series of handlers you must copy and paste in a movie script.
    Here, I show you how to create the contextual menu of an asian restaurant in
    a 3D town. When you click on models whose name begin with Restaurant or
    Dragon , the contextual menu appears.

    Cheers,
    Karl.



    on startMovie
    initMenus()
    end


    on initMenus


    3DMember = member("scene")
    3DSprite = sprite(1)
    arrowBitmap = member("arrow")
    arrowBitmapRollOver = member("arrow_rollover")
    MenuFont = "Arial"
    MenuFontSize = 14
    activeModelsPrefix = ["Restaurant", "Dragon"]


    -- Menu Class

    MenuClass = new(script "MenuClass")


    -- Order submenu

    mi1 = new(script "MenuItem", 3DMember, 3DSprite, "Sushi", #sushi,\
    "Toshiro Mifune's favorite", MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0,
    42, 0, true, false, false, 0,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi2 = new(script "MenuItem", 3DMember, 3DSprite, "Sashimi", #sashimi,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0, 42, 0, true, false,
    false, 1,\
    arrowBitmap, arrowBitmapRollOver, false)

    mi3 = new(script "MenuItem", 3DMember, 3DSprite, "Raw fish", #rawFish,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0, 42, 0, true, false,
    false, 2,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi4 = new(script "MenuItem", 3DMember, 3DSprite, "Chop Suey", #chopSuey,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0, 42, 0, true, false,
    false, 3,\
    arrowBitmap, arrowBitmapRollOver, false)

    myMenuItems = [mi1, mi2, mi3, mi4]

    OrderSubmenu = new(script "ContextualMenu", MenuClass, activeModelsPrefix
    , true,
    "Order",\
    myMenuItems, 3DSprite.member, 3DSprite, 192, 128, 222, 70, CamSource)


    -- Main menu

    mi1 = new(script "MenuItem", 3DMember, 3DSprite, "Contact us",
    #contactUs,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 0,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi2 = new(script "MenuItem", 3DMember, 3DSprite, "Order Meals",
    OrderSubmenu,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 1,\
    arrowBitmap, arrowBitmapRollOver, false)

    mi3 = new(script "MenuItem", 3DMember, 3DSprite, "Our Employees",
    #ourEmployees,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 2,\
    arrowBitmap, arrowBitmapRollOver, false)

    mi4 = new(script "MenuItem", 3DMember, 3DSprite, "History", #history,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 3,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi5 = new(script "MenuItem", 3DMember, 3DSprite, "Prize won", #prizeWon,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 4,\
    arrowBitmap, arrowBitmapRollOver, false)

    myMenuItems = [mi1, mi2, mi3, mi4, mi5] -- you can add #separator to add a
    line between two menu items

    PlayerContextMenu = new(script "ContextualMenu", MenuClass,
    activeModelsPrefix ,
    false, "Viet Hung",\
    myMenuItems, 3DSprite.member, 3DSprite, 128, 128, 128, 70, CamSource)


    end


    -- Callback handler for menu item actions

    on handlerCallback mHandlerID, mParam1, mParam2, mParam3, mParam4

    if gGbl.pDebug then put mHandlerID && "called on" && mParam1


    case mHandlerID of

    -- MenuItem calls

    #sushi : orderSushi(mParam1)
    #sashimi : orderSashimi()
    #rawFish : orderRawFish()
    #chopSuey : orderChopSuey()
    #contactUs
    #ourEmployees
    #history
    #prizeWon

    end case

    end


    on orderSushi mParam
    put mParam1
    end orderSushi


    on orderSashimi
    end orderSashimi


    on orderRawFish
    end orderRawFish


    on orderChopSuey
    end orderChopSuey

    on contactUs
    end

    on ourEmployees
    end

    on history
    end

    on prizeWon
    end










    Karl Sigiscar Guest

  5. #4

    Default Re: How to use Contextual Menu in Chrome Lib?

    Hi,

    Ignore the previous posts. There were some missing bits of code and info.

    Here is a series of handlers you must copy and paste in a movie script.
    Here, I show you how to create the contextual menu of an asian restaurant in
    a 3D town. When you click on models whose name begin with Restaurant or
    Dragon , the contextual menu appears. There is a main contextual menu "Viet
    Hung" and the OrderSubmenu called on the Order Meals menu item. A menu item
    either calls a handler or is a link to another (sub)menu. However, you
    cannot go deeper than a main menu and its submenus. The main menu and its
    submenus position themselves according to the screen border and the mouse
    position when the menu appears.

    Cheers,
    Karl.



    on startMovie
    initMenus()
    end


    on initMenus


    3DMember = member("scene")
    3DSprite = sprite(1)
    arrowBitmap = member("arrow")
    arrowBitmapRollOver = member("arrow_rollover")
    MenuFont = "Arial"
    MenuFontSize = 14
    activeModelsPrefix = ["Restaurant", "Dragon"]


    -- Menu Class

    MenuClass = new(script "MenuClass")


    -- Order submenu

    mi1 = new(script "MenuItem", 3DMember, 3DSprite, "Sushi", #sushi,\
    "Toshiro Mifune's favorite", MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0,
    42, 0, true, false, false, 0,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi2 = new(script "MenuItem", 3DMember, 3DSprite, "Sashimi", #sashimi,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0, 42, 0, true, false,
    false, 1,\
    arrowBitmap, arrowBitmapRollOver, false)

    mi3 = new(script "MenuItem", 3DMember, 3DSprite, "Raw fish", #rawFish,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0, 42, 0, true, false,
    false, 2,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi4 = new(script "MenuItem", 3DMember, 3DSprite, "Chop Suey", #chopSuey,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 48, 0, 42, 0, true, false,
    false, 3,\
    arrowBitmap, arrowBitmapRollOver, false)

    myMenuItems = [mi1, mi2, mi3, mi4]

    OrderSubmenu = new(script "ContextualMenu", MenuClass, activeModelsPrefix
    , true,
    "Order",\
    myMenuItems, 3DSprite.member, 3DSprite, 192, 128, 222, 70, CamSource)


    -- Main menu

    mi1 = new(script "MenuItem", 3DMember, 3DSprite, "Contact us",
    #contactUs,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 0,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi2 = new(script "MenuItem", 3DMember, 3DSprite, "Order Meals",
    OrderSubmenu,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 1,\
    arrowBitmap, arrowBitmapRollOver, false)

    mi3 = new(script "MenuItem", 3DMember, 3DSprite, "Our Employees",
    #ourEmployees,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 2,\
    arrowBitmap, arrowBitmapRollOver, false)

    mi4 = new(script "MenuItem", 3DMember, 3DSprite, "History", #history,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 3,\
    arrowBitmap, arrowBitmapRollOver, true)

    mi5 = new(script "MenuItem", 3DMember, 3DSprite, "Prize won", #prizeWon,\
    void, MenuFont, MenuFontSize, 0, 0, 255, 0, 247, 0, 248, 0, true, false,
    false, 4,\
    arrowBitmap, arrowBitmapRollOver, false)

    myMenuItems = [mi1, mi2, mi3, mi4, mi5] -- you can add #separator to add a
    line between two menu items

    PlayerContextMenu = new(script "ContextualMenu", MenuClass,
    activeModelsPrefix ,
    false, "Viet Hung",\
    myMenuItems, 3DSprite.member, 3DSprite, 128, 128, 128, 70, CamSource)


    end


    -- Callback handler for menu item actions

    on handlerCallback mHandlerID, mParam1, mParam2, mParam3, mParam4

    if gGbl.pDebug then put mHandlerID && "called on" && mParam1


    case mHandlerID of

    -- MenuItem calls

    #sushi : orderSushi(mParam1)
    #sashimi : orderSashimi()
    #rawFish : orderRawFish()
    #chopSuey : orderChopSuey()
    #contactUs : contactUs()
    #ourEmployees : ourEmployees()
    #history : history()
    #prizeWon : prizeWon()

    end case

    end


    on orderSushi mParam
    put mParam1
    end orderSushi


    on orderSashimi
    end orderSashimi


    on orderRawFish
    end orderRawFish


    on orderChopSuey
    end orderChopSuey

    on contactUs
    end

    on ourEmployees
    end

    on history
    end

    on prizeWon
    end










    Karl Sigiscar Guest

  6. #5

    Default Re: How to use Contextual Menu in Chrome Lib?

    I know there sushi and sashimi are Japanese meals only. But I don't have all
    the asian meals in memory. It was just for the sake of the example ;-)


    Karl Sigiscar Guest

  7. #6

    Default Re: How to use Contextual Menu in Chrome Lib?

    Contextual Menu Parent Scripts

    The code in the Chrome Lib has been fixed and commented.
    I added an init sample movie script.
    Two arrow bitmaps (32 bits with alpha) have also been added to indicate
    submenus.
    I added a sample dir

    Chrome Lib:
    [url]http://membres.lycos.fr/karlsigiscar/shockwave3d[/url]

    Sample Contextual Menu Sample (1308 KB). You can also download the .dir from
    this page:
    [url]http://membres.lycos.fr/karlsigiscar/shockwave3d/contextual_menu.htm[/url]

    Best regards,
    Karl Sigiscar.



    Karl Sigiscar Guest

  8. #7

    Default Re: How to use Contextual Menu in Chrome Lib?

    Thank you so much Karl. I really appreciate your help.

    Sincerely,
    LiM


    LiM the Manop webforumsuser@macromedia.com Guest

  9. #8

    Default Re: How to use Contextual Menu in Chrome Lib?

    You're welcome.

    Today, I updated the sample dir and the Menu Item parent script in order to
    handle a list of parameters in handler calls as opposed to one parameter
    only.

    Cheers,
    Karl.


    Karl Sigiscar Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139