Advertisement
Guest User

AS3

a guest
Jun 24th, 2023
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ActionScript 3 1.96 KB | Source Code | 0 0
  1.  
  2.       public function openSong(param1:ContextMenuEvent) : void
  3.       {
  4.          navigateToURL(new URLRequest(this.song_link));             //open YT Link
  5.       }
  6.      
  7.       public function openVideo(param1:ContextMenuEvent) : void
  8.       {
  9.          navigateToURL(new URLRequest(this.og_video_link));         //open YT Link
  10.       }
  11.  
  12.  
  13.       internal function frame1() : *
  14.       {
  15.          this.my_menu = new ContextMenu();                          //creates new ContextMenu Object
  16.          this.my_menu.hideBuiltInItems();                           //disables normal entries like "Quality" "show all" "100%" etc.
  17.          this.flash_name = new ContextMenuItem("FILENAME");         //creates new menu entry
  18.          this.song_name = new ContextMenuItem("SONGNAME");
  19.          this.video_name = new ContextMenuItem("VIDEO");
  20.          this.og_video = new ContextMenuItem("VIDEO_LINK");
  21.          this.notice = new ContextMenuItem("WHO MADE THIS");
  22.          this.song_link = "YT LINK";                                //Variable with YT Link
  23.          this.og_video_link = "YT LINK";                            //Variable with YT Link
  24.          this.flash_name.enabled = false;                           //probably whether the menu object is greyed out or clickable (in this case greyed out)
  25.          this.song_name.separatorBefore = true;
  26.          this.song_name.enabled = true;
  27.          this.video_name.enabled = false;
  28.          this.og_video.enabled = true;
  29.          this.notice.enabled = false;
  30.          this.notice.separatorBefore = true;
  31.          this.song_name.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,this.openSong);                          //An event listener that checks whether the menu object (in this case "openSong") has been clicked on. if yes, execute function.
  32.          this.og_video.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,this.openVideo);
  33.          this.my_menu.customItems.push(this.flash_name,this.song_name,this.video_name,this.og_video,this.notice);   //add the menu items to your ContextMenu Object
  34.          contextMenu = this.my_menu;                                                                                //assign new ContextMenu
  35.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement