PDA

View Full Version : Add Drag Functionality to a Component


Blackthorn
01-04-2008, 11:48 AM
How do I add drag functionality to a MediaPlayback component so that it allows click presses through to the buttons on the player but will drag when clicked else where?

Sample Code:
mc_Player.onPress = function(){
this.startDrag();
}

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

The above code is not clever enough. Any ideas?

Blackthorn

self
01-04-2008, 12:58 PM
uhm i havent used the component before, but i think i know where your problem is: you got an mc containing buttons/mcs with mouse-events, and you want to be able to drag the whole thing if it is clicked, except if one of its buttons is clicked.

can you insert a background button to your player? eg just a rectangle with alpha=0 with the drag code inside. if this is possible and put in a layer behind the buttons, it will only be activated if no other mouse-event-element is clicked.