georgia
February 21, 2003, 10:57pm
1
I have a button which is clicked and a second menu drops down. At that point, I have that second menu dragable along the x so that various buttons (there will be more) can be chosen.
My question is: is it possible to drag the menu with a smoother motion? Perhaps so that when the mouse is released, it eases to a stop? Is using drag the right way to go?
http://www3.sympatico.ca/stylusproductions/upload_fla/button_row.html
(And only posting in one place )
Thanks,
georgia
system
February 21, 2003, 11:08pm
2
lol why have you deleted the other thread ?
ok … if i got your question:
place all the buttons in the submenu into a movie clip
then just follow this tutorial
hope it helps =)
system
February 21, 2003, 11:24pm
3
If the movie clips instance name was “box” then you would put this on a FRAME in the same timeline as the movie clip.
box.onPress = function() {
this.onEnterFrame = function() {
endX = _root._xmouse;
this._x += (_root._xmouse-this._x)/5;
};
};
box.onRelease = _root.box.onReleaseOutside=function () {
endX = _root._xmouse;
this.onEnterFrame = function() {
this._x += (endX-this._x)/5;
if (this._x == endX) {
delete this.onEnterFrame;
}
};
};
system
February 22, 2003, 1:00am
4
Thank you lostinbeta, that code works great. Now I’m going to ask another question which I hope doesn’t sound too dense.
I went into my “clip2” which is the sliding bar. It is made up of the 4 movie clips. I selected the 222clip and gave it the action:
onClipEvent (mouseDown) {
getURL(“http://www.recipesplus.ca ”, “_blank”);
}
Problem is, when I test the whole movie, the 222clip doesn’t react. Even after the drag is released, it still doesn’t work.
I’m sure this is a simple thing, sorry to ask such a “newbie” question.:-\
georgia
system
February 22, 2003, 1:42am
5
Sorry, that was my mistake. I wasn’t thinking.
Try this method… I didn’t test it, but it should work.
box.onEnterFrame = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.onMouseDown = function() {
this.onEnterFrame = function() {
endX = _root._xmouse;
this._x += (_root._xmouse-this._x)/5;
};
};
} else {
this.onMouseUp = function() {
endX = _root._xmouse;
this.onEnterFrame = function() {
this._x += (endX-this._x)/5;
if (this._x == endX) {
}
};
};
}
};
system
February 22, 2003, 2:13am
6
Hey lostinbeta, thanks for taking the time with this.
Now the button is active, BUT that overrides the draging.:hair:
It seems to be either draging OR active buttons.
Thanks again,
georgia
system
February 22, 2003, 4:45am
7
Alright, well as I said… it was untested. I will see if I can set up an example.
system
February 22, 2003, 5:31am
8
Alright, I created this fully commented .fla file for you. I used a drag button instead of being the whole item draggable. It is more efficient/effective that way. All the code is in the slider MC. Enjoy
Oh yeah… note: I just realized I used movie clips as buttons (I have grown accustomed to it). This is NOT a necessity for the standard buttons, but it is a necessity for the drag button. The drag button MUST be a movie clip symbol, but the other buttons can be regular buttons symbols OR movie clips.
system
February 22, 2003, 6:06am
9
You have been very kind. I’ll try it out and see what I can learn from it.
:beam:
Thanks
Georgia
system
February 22, 2003, 6:11am
10
No problem. It has been my pleasure I hope you can learn a thing or two from that file
system
February 22, 2003, 6:13am
11
I’m on a mac. I can’t download it:(
Can you believe it?
georgia
system
February 22, 2003, 6:20am
12
If it saves it as a .php… just change the extension to .fla and it should work. Others have done that.
If not… try the .zip file.
system
February 22, 2003, 3:20pm
13
I went over the fla and learned much, thank you very, very much. My last question as it applies to the issue is:
Is it possible to have the whole sliding part made up of active buttons? Or then would it not be posible to drag?
georgia
system
February 22, 2003, 5:35pm
14
Well the problem with that method would be that your buttons are still clickable… so it will be easy to accidently click a wrong button. So I don’t recommend doing that at all, its not very functional.