Ask a Question related to Macromedia Director 3D, Design and Development.
-
LiM the Manop webforumsuser@macromedia.com #1
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
-
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 -
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... -
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... -
Illustrator 10 contextual menu error
Woops, sorry. Have you checked for corrupt fonts? Try turning off your Antivirus software? -
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... -
Karl Sigiscar #2
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
-
Karl Sigiscar #3
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
-
Karl Sigiscar #4
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
-
Karl Sigiscar #5
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
-
Karl Sigiscar #6
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
-
LiM the Manop webforumsuser@macromedia.com #7
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
-
Karl Sigiscar #8
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



Reply With Quote

