Advertisement
Guest User

AS2

a guest
Jun 24th, 2023
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ActionScript 1.50 KB | Source Code | 0 0
  1. function emptyFunction()
  2. {
  3.                                                                     //empty function
  4. }
  5.  
  6. function openVisualLink()
  7. {
  8.    getUrl("e.g. YT Link", "_blank");                                //open new URL in a new TAB (remove the second parameter to open new URL in current TAB)
  9. }
  10.  
  11. function openMusicLink()
  12. {
  13.    getUrl("e.g. YT Link", "_blank");                                //open new URL in a new TAB (remove the second parameter to open new URL in current TAB)
  14. }
  15.  
  16. var credits = new ContextMenu();                                    //creates new ContextMenu Object
  17.  
  18. credits.hideBuiltInItems();                                         //disables normal entries like "Quality" "show all" "100%" etc.
  19.  
  20. var link1 = new ContextMenuItem("ENTER TEXT HERE", openMusicLink)//creates new menu entry (the function "openMusicLink" is specified here. this is executed when someone clicks on the menu entry)
  21. var link2 = new ContextMenuItem("ENTER TEXT HERE", openVisualLink);
  22.  
  23. var menu1 = new ContextMenuItem("ENTER TEXT HERE",emptyFunction);   //creates new menu entry (A function must be specified. For this reason, an empty function is assigned here)
  24. var menu2 = new ContextMenuItem("ENTER TEXT HERE",emptyFunction);
  25. var menu3 = new ContextMenuItem("ENTER TEXT HERE",emptyFunction);
  26.  
  27. menu1.separatorBefore = true;                                       //adds an line above of entry "menu1".
  28.  
  29. credits.customItems.push(link1);                                    //add the menu items to your ContextMenu Object
  30. credits.customItems.push(link2);
  31. credits.customItems.push(menu1);
  32. credits.customItems.push(menu2);
  33. credits.customItems.push(menu3);
  34.  
  35. _root.menu = credits;                                               //assign new ContextMenu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement