Drag menu in flash
- Started
- Last post
- 5 Responses
- bomy_dick
hi everyone
well i'm trying to do a simple drag with a movie clip, this movie clip contains text buttons..
it's name is "menu"
i 've inserted the buttons in the menu movie clip and here is the code :
// DRAG MENU
menu.onPress = function () {
startDrag(menu,false,0,0,1024,56...}
menu.onRelease = function () {
stopDrag();
}// END DRAG
the clip is moving fine, with the text buttons in it (the clip is a simple rectangle with 90 % alpha)
but the buttons are not reacting : no roll over..)if anyone can help
tia
- unfittoprint0
the menu.onPress event overlaps the buttons events beneath...
You should make an invisble button inside the menu (the same size as it), beneath the buttons and put this in the menu's action layer:
// DRAG MENU
dragButton.onPress = function () {
startDrag(this._parent,false,0,0...
1024,560);}
dragButton.onRelease = function () {
stopDrag();
}
- bomy_dick0
thx man
i'll try this
i thought the code had to be on the main scenario, not inside the movie clip
- bomy_dick0
i've tried that in the movie clip and on the scene.
now the buttons are working ok wut the menu itself is not moving anymore
i've tried a few different things but it won't move
menu.dragButton.onPress = function () {
startDrag(menu.dragButton,false... 1024,560);}
menu.dragButton.onRelease = function () {
stopDrag();
}
- unfittoprint0
the dragButon refers to the drag button not the _level0, so you have to call the button's parent to achieve the drag action:
menu.dragButton.onPress = function () {
startDrag(this._parent, false,0,0, 1024,560);}
menu.dragButton.onRelease = function () {
stopDrag();
}good luck.
- bomy_dick0
my fault sorry,
thx a lot man, have a good sunday !