Buttons in a draggable Movieclip

I have a MovieClip that has startDrag(). Inside the MC I have buttons, but when I click the buttons it wants to drag. How do I make the buttons clickable?

Hi,

I’d make a kind of handle to move your movieClip ( like bars on windows) or you can disable the dragging on rolling over the buttons.

SHO

I have encountered your problem before and the way i got round it was to do the following:

  1. Make the movie clip you want

  2. go inside the movie clip and then make the artwork a movieclip again.

  3. add the buttons but put them as movie clips

  4. add the codes:


//when the clip is on the stage...
onClipEvent (enterFrame) {
    //when this is pressed...
    _root.onPress = function() {
        //this will start to drag
        _parent.starDrag();
        //then the mouse is released...
        this.onRelease = function() {
            //this will stop draggin
            _parent.stopDrag();
        };
    };
}

the above code should be placed on the second symbol
stage>group with symbols>artwork symbol


//when the clip is on the stage
onClipEvent (enterFrame) {
    //if the mouse is pressed...
    this.onPress = function() {
        //if the mouse it pressed and moved...
        this.onMouseMove = function() {
            //start draggin
            _parent.startDrag();
            //set a global varable to true
            _global.moved = true;
        };
    };
    //when the mouse is up...
    this.onMouseUp = function(){
        //test to see if moved to true
        if(_global.moved == true){
            //if it is...
            //reset the variable to false
            _global.moved = false
            //stop the drag
            _parent.stopDrag();
            //do what you want it to do
        //otherwise...
        } else {
            //stop draggin
            _parent.stopDrag()
        }
    }
}

put this on the buttons

i have done this code countless times and it has worked for me, msg me if you need any help.

hope your problems are solved now,

Stupid Saint

http://www.4shared.com/file/48900566/78a25378/sol.html

download this and see the fla structure

add startdrag to the parent but onPress of the invisible button