A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [HELP] Action Script for Mouse

  1. #1
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167

    [HELP] Action Script for Mouse

    Hey everyone, just have a quick question. I am part of a small team making an Rpg in flash (theres a thread about it in the Games Forum)

    Anyways, I was just working on a customizable right click menu which we're going to need, so I found a tutorial that did just that in MX 2004

    But it didnt work *Shows Code*


    function doSomething(){}

    MENU = new ContextMenu();
    MENU.hideBuiltInItems();
    Functioned = new ContextMenuItem("This movie is copyrighted by Your Company Name", doSomething);
    MENU.customItems.push(Functioned);
    _root.menu = MENU;


    The code is pretty simple, just put it in the default layer. But ... well it doesnt work. It doesnt give an error or anything, it just doesnt work

    And yes, I have MX 2004 which the tutorial required ...

    Anyways, your help will be greatly appreaciated

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518

    Weird - it worked for me...

    Code:
    MENU = new ContextMenu();
    MENU.hideBuiltInItems();
    Functioned = new ContextMenuItem("This movie is copyrighted by Your Company Name", doSomething);
    MENU.customItems.push(Functioned);
    _root.menu = MENU;
    
    function doSomething(menuObj, objObj){
    	trace("stuff");
    }

  3. #3
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Really *blink blink*

    Ok, lets go though this step by step haha :P


    1) Start new project in Macromedia MX
    2) Place code in the default layer, first keyframe:

    MENU = new ContextMenu();
    MENU.hideBuiltInItems();
    Functioned = new ContextMenuItem("This movie is copyrighted by Your Company Name", doSomething);
    MENU.customItems.push(Functioned);
    _root.menu = MENU;

    function doSomething(menuObj, objObj){
    trace("stuff");
    }


    3) Run and watch as it works...

    Hmm, thats wierd ... , well thanks anyways

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center