Posted By

youngster on 11/10/10


Tagged

Context mwnu


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

sexyflash
onemanstudio


Context Menu


 / Published in: ActionScript 3
 

  1. import flash.ui.ContextMenu;
  2. import flash.ui.ContextMenuItem;
  3. import flash.events.ContextMenuEvent;
  4. import flash.net.navigateToURL;
  5. import flash.net.URLRequest;
  6.  
  7. var cm:ContextMenu=new ContextMenu()
  8. var cmi01:ContextMenuItem=new ContextMenuItem("play animation")
  9. cmi01.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,c01)
  10. function c01(event:ContextMenuEvent){
  11. rect_mc.play()
  12. }
  13.  
  14. var cmi02:ContextMenuItem=new ContextMenuItem("stop animation",true)
  15. cmi02.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,c02)
  16. function c02(event:ContextMenuEvent){
  17. rect_mc.stop()
  18. }
  19.  
  20. var cmi03:ContextMenuItem=new ContextMenuItem("webmyway.co.cc",true)
  21. cmi03.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,c03)
  22. function c03(event:ContextMenuEvent){
  23. navigateToURL(new URLRequest("http://webmyway.co.cc"), "_blank")
  24. }
  25.  
  26. var cmi04:ContextMenuItem=new ContextMenuItem("copyright © All rights recieved",false,false,)
  27. cmi04.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,c04)
  28. function c04(event:ContextMenuEvent){
  29. navigateToURL(new URLRequest("http://webmyway.co.cc"), "_blank")
  30. }
  31.  
  32. cm.customItems.push(cmi04,cmi03,cmi02,cmi01)
  33. rect_mc.contextMenu=cm
  34. cm.hideBuiltInItems()

Report this snippet  

You need to login to post a comment.