I’m trying to use the context menu to add textboxes to the stage. So far I’ve managed to create the menu item and get the MC to dynamically attach to the stage. However, I also wish to be able to create several clips, which it doesn’t. Can someone tell me how that could be achieved please?
ActionScript Code:
[FONT=Courier New][LEFT]root_cm = [COLOR=#000000]**new**[/COLOR] [COLOR=#0000FF]ContextMenu[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
root_cm.[COLOR=#0000FF]hideBuiltInItems[/COLOR]COLOR=#000000[/COLOR];
root_cm.[COLOR=#0000FF]customItems[/COLOR].[COLOR=#0000FF]push[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]new[/COLOR] [COLOR=#0000FF]ContextMenuItem[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“Add note”[/COLOR], itemHandler[COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]function[/COLOR] itemHandler[COLOR=#000000]([/COLOR]obj:[COLOR=#0000FF]Object[/COLOR], item:[COLOR=#0000FF]ContextMenuItem[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"text_ti"[/COLOR], [COLOR=#FF0000]"text_ti"[/COLOR], [COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]_x[/COLOR] = [COLOR=#000080]100[/COLOR];
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]_y[/COLOR] = [COLOR=#000080]100[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#0000FF]_root[/COLOR].[COLOR=#0000FF]menu[/COLOR] = root_cm;
[/LEFT]
[/FONT]