What is wrong with this AS? I cant get the hittest to work on these buttons which are now movieclips.
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true))
if (_currentframe>=75) {
gotoAndPlay(91);
} else {
if (_currentframe>=96) {
gotoAndPlay(96);
updateAfterEvent();
}
}
system
December 3, 2002, 6:06pm
2
[EDIT=Erased post]…and he missed! [/EDIT]
:*(
system
December 3, 2002, 6:45pm
3
Well for one you missed a curly bracket
Not sure if that is the whole problem, but I can tell that one right off the bat…
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_currentframe>=75) {
gotoAndPlay(91);
} else {
if (_currentframe>=96) {
gotoAndPlay(96);
updateAfterEvent();
}
}
}
}
system
December 3, 2002, 6:52pm
4
create an invisible mc and attach it to the mouse using
onClipEvent (mouseMove) {
_x=_root._xmouse
_y=_root._ymouse
updateAfterEvent(mouseMove)
}
give this mc an instance name like “mouseTarget” then use hitTest -
if (this.hitTest(_root.mouseTarget)) { }
system
December 3, 2002, 6:56pm
5
I did this and worked perfect… so its not the hitTest that is the problem.
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
trace("over");
} else {
trace("not over");
}
}
system
December 3, 2002, 6:57pm
6
You could try…
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_currentframe>=75 && _currentframe<=95) {
gotoAndPlay(91);
} else {
if (_currentframe>=96) {
gotoAndPlay(96);
updateAfterEvent();
}
}
}
}
system
December 3, 2002, 9:16pm
7
Thanks for replying guys, but the problem continues. Basically what I have is a movie clip that alphas from 0 to 100 on rollover, that part is simple, but I also want it to control an alpha of a 2nd movie clip too. So when I rollover and rollout on that movieclip, it fades itself and another movieclip at the same time. I already achieved this with the rollover and rollout AS, but its not sensitive enough, if i roll my mouse over it too fast then it will be stuck on a state. I thought if I used the hittest, it would make it more sensitive to the mouse, but so far I havent been able to apply the hittest it. I hope you guys understand what I’m trying to do. :-\
system
December 3, 2002, 10:27pm
8
Use AS to tween the alpha instead of a motion tween.
system
December 3, 2002, 10:47pm
9
Thats the problem, I dont know how to do that, I wanna use the hittest to control the alphas of both movieclips, but so far no luck…
system
December 3, 2002, 10:57pm
10
I will whip up an example…
::poof::
Wait… which version of Flash?
If it is MX, I can whip up an example, if it is Flash 5, hmmm, I can’t help ya there
system
December 3, 2002, 11:02pm
11
I’m using MX, thank goodness!! thanks Lost! I owe you big time on this cause its for a important project. =)
system
December 3, 2002, 11:12pm
12
Ok, check my attachment
I set the original alpha of the rollOver clip to 10 so you can see where you were rolling over to test it, so the animation of it may seem a bit off, but the idea is there.
I hope it was close to what you wanted to do
system
December 3, 2002, 11:17pm
13
Wait wait wait… I noticed a glitch in the last script where if you moused over it real fast over and over it made it invisible.
Try this one
system
December 3, 2002, 11:41pm
14
crazy lost! thats exactly what i needed, thanks man!! =)
system
December 3, 2002, 11:42pm
15
No problem, always glad to help
Especially on important projects :beam: