I have an Arrow Mc and a ball Mc, plus a button to release the Arrow. On the button I have:
on (release) {
while (_root.Arrow._x<0) {
if (_root.Arrow.hitTest(_root.ball)) {
setProperty ("_root.ball", _alpha, 0);
_root.Man.gotoAndPlay(10);
} else {
setProperty ("_root.Arrow", _alpha, 100);
_root.Man.gotoAndStop(3);
_level0.trigger++;
}
}
setProperty ("_root.Arrow", _x, flight+(target += 200));
_root.Man.gotoAndStop(2);
}
And on the Arrow I have:
onClipEvent (load) {
this._x=100;
_root.target = 0;
}
onClipEvent (enterFrame) {
current = this._x;
flight = current+_root.target;
setProperty (this, _x, flight+target);
}
Does anyone have any idea why the Arrow is going through the ball without doing the hitTest? I had it working with just having the arrow going to _xposition 900, but when I tried to get it to "move" instead of jump to the _xposition 900, it doesn't seem to work. Any help would be great. It's actually for a Thanksgiving card to my sister. I had this:
which had a turkey going up and down in random _y and static _x(900), which worked fine 'cause the arrow ended up in that _x position.
I tried to have the turkey do the random_y, plus change the _x, which left the turkey outside of the ending _x position(900) of the Arrow. So I tried this:
(the ball is only in there for test purposes.
Thanks, anyone for your help. Adam
on (release) {
while (_root.Arrow._x<0) {
if (_root.Arrow.hitTest(_root.ball)) {
setProperty ("_root.ball", _alpha, 0);
_root.Man.gotoAndPlay(10);
} else {
setProperty ("_root.Arrow", _alpha, 100);
_root.Man.gotoAndStop(3);
_level0.trigger++;
}
}
setProperty ("_root.Arrow", _x, flight+(target += 200));
_root.Man.gotoAndStop(2);
}
And on the Arrow I have:
onClipEvent (load) {
this._x=100;
_root.target = 0;
}
onClipEvent (enterFrame) {
current = this._x;
flight = current+_root.target;
setProperty (this, _x, flight+target);
}
Does anyone have any idea why the Arrow is going through the ball without doing the hitTest? I had it working with just having the arrow going to _xposition 900, but when I tried to get it to "move" instead of jump to the _xposition 900, it doesn't seem to work. Any help would be great. It's actually for a Thanksgiving card to my sister. I had this:
which had a turkey going up and down in random _y and static _x(900), which worked fine 'cause the arrow ended up in that _x position.
I tried to have the turkey do the random_y, plus change the _x, which left the turkey outside of the ending _x position(900) of the Arrow. So I tried this:
(the ball is only in there for test purposes.
Thanks, anyone for your help. Adam