jerry
October 17, 2002, 10:38am
1
hey!
I’m trying to make an object (MC) move, when rolling over a button! I got 2 buttons, one to get the object to move up, and one to get it to move down!
I found this code:
onClipEvent (load) {
amount = 5;
}
onClipEvent (enterFrame) {
if (_root._ymouse>350 && this._y>"-100") {
this._y -= amount;
}
if (_root._ymouse<180 && this._y<"630") {
this._y += amount;
}
}
it’s the same function I’m looking for, where I can define the limit for the movement, but I can’t quite figure out how to apply the function to the buttons, so the object only moves when rolling over the buttons!?..
system
October 17, 2002, 11:14am
2
I’d do it the other way around: when you rollover the button, it tells the clip to move:
on (RollOver) {
_root.yourClip._x+=10;
}
Or something like that.
Cheers.
pom :asian:
[SIZE=1]spam: Vote for the contest please :)[/SIZE]
system
October 17, 2002, 11:25am
3
THX, I’m getting there…
but I can’t get the MC to move smoothly, I want it to move until it reach a specific limit, and then stop!..?
system
October 17, 2002, 1:42pm
4
Dynamic callback functions, man. I tried to explain it in the AS tricks section. Check it and if you are still clueless, post back.
pom