Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function openSong(param1:ContextMenuEvent) : void
- {
- navigateToURL(new URLRequest(this.song_link)); //open YT Link
- }
- public function openVideo(param1:ContextMenuEvent) : void
- {
- navigateToURL(new URLRequest(this.og_video_link)); //open YT Link
- }
- internal function frame1() : *
- {
- this.my_menu = new ContextMenu(); //creates new ContextMenu Object
- this.my_menu.hideBuiltInItems(); //disables normal entries like "Quality" "show all" "100%" etc.
- this.flash_name = new ContextMenuItem("FILENAME"); //creates new menu entry
- this.song_name = new ContextMenuItem("SONGNAME");
- this.video_name = new ContextMenuItem("VIDEO");
- this.og_video = new ContextMenuItem("VIDEO_LINK");
- this.notice = new ContextMenuItem("WHO MADE THIS");
- this.song_link = "YT LINK"; //Variable with YT Link
- this.og_video_link = "YT LINK"; //Variable with YT Link
- this.flash_name.enabled = false; //probably whether the menu object is greyed out or clickable (in this case greyed out)
- this.song_name.separatorBefore = true;
- this.song_name.enabled = true;
- this.video_name.enabled = false;
- this.og_video.enabled = true;
- this.notice.enabled = false;
- this.notice.separatorBefore = true;
- 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.
- this.og_video.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,this.openVideo);
- 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
- contextMenu = this.my_menu; //assign new ContextMenu
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement