A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Dragable menu help please!

  1. #1

    Dragable menu help please!

    I am trying to do the following:

    I created a menu in bitmap and inported it into Flash as a movie clip, I have a drag button and a minimize button on the menu... I am working on the drag button at the moment. In the menu movie clip I created a transparent block over the drag button, and turned the symbol into a button.

    Here is my problem, I cannot apply the required action script to the button:

    on (press) {
    startDrag ("/menu");
    }
    on (release) {
    stopDrag ();
    }

    The window says "Current selection cannot have actionscript applied to it." When I tried to apply the script to the symbol from the movie clip menu (with the button selected), Flash returns with the error that on (press) even can only be applied to buttons...

    Where or how should I apply the code? I have been digging around for hours with no luck, any help will be greatly appreciated!

  2. #2
    Member
    Join Date
    Jun 2004
    Posts
    72
    can you post the fla and we can havea look at it.

  3. #3
    How should I know!? Biff Tanon's Avatar
    Join Date
    Jun 2001
    Posts
    748
    Make sure you give it the full path to the movie clip.
    Here is an example:

    code:

    on (press) {
    startDrag("_parent.dragMenu");
    }
    on (release) {
    stopDrag();
    }




    I created a movie clip called dragMenu. Then inside of dragMenu there is a button with the above AS on it. The _parent tells the AS to apply the actions one "level" up.
    Hope this helps....
    [something cool goes here]

  4. #4
    I guess my problem is that I don't know how to go about adding actionscript to a button. Versus where I can use the actonscript window for the movie clip.

    I noticed that all the "valid" ones are in scene 1, and I do not notice this newly created button in the scene... could that be why? I have attached the file just to clarify if it's necessary.

    Thank you once again for all your helps!

    *** edit ***
    Don't think the file attached correctly, here is a link:

    http://www.mokoloco.com/AA/mokoloco3.fla

    Thanks!
    Last edited by PupChow; 09-08-2004 at 03:20 PM.

  5. #5
    How should I know!? Biff Tanon's Avatar
    Join Date
    Jun 2001
    Posts
    748
    can you save it in MX format? (not 2004)
    [something cool goes here]

  6. #6
    Sure thing, here it is in MX format. What's the difference btw? Thanks in advance!

    http://www.mokoloco.com/AA/mokoloco4.fla

  7. #7
    How should I know!? Biff Tanon's Avatar
    Join Date
    Jun 2001
    Posts
    748
    Hmmm, It still won't let me open it. "Unexpected Format" Are you using a mac or pc?
    [something cool goes here]

  8. #8
    I am using a PC version of Flash 2004 MX. I tried opening the link and it worked for me, maybe there's some compatibility issue... let me try to describe the problem better.

    I am having trouble assigning the action script to the button.

    The movie the movie is set up, the whole menu bar is a movie clip, and within the movie clip I have a button in a seperate layer. I tried putting actionscript on the button but it wouldn't let me. However, if I move the button to the main scene (scene 1), I can apply actionscipt to the button with no problem (though the effect didn't work, but at least I can apply the script).

    I have worked with Director before, but never Flash, so maybe I am missing something pretty basic here. I am under the impression that I can do all those menu bar effects within the movie symbol of the menu bar and simply dump the whole movie symbol into Scene 1 so it will be clean and the timeline won't be so cluttered... is there something wrong with my logic? Thank you once again, I really appreciate you taking your time to help me out.

  9. #9
    I was reading up on more tutorials and actually got it to work by removing the movie clip name from the quotes:

    on (press) {
    startDrag("");
    }
    on (release) {
    stopDrag();
    }
    Will this be okay? Or might I run into more problems in the future? Thanks again!

  10. #10
    Member
    Join Date
    Jun 2004
    Posts
    72
    menuDrag.onPress = function() {
    startDrag(this);
    };


    menuDrag.onRelease = function() {
    stopDrag(this);
    };

    should do it.

  11. #11
    Member
    Join Date
    Aug 2004
    Posts
    34
    here is another dragable menu to look in..

    bah.. flash mx2004 and normal mx don't work very well together..
    Attached Files Attached Files

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