Tutorials Home
What's New
Top Rated
Submit
myTutes
Random!
zapper hitTest
Author: MoKkAn
First......oh by the way this is my second tutorial so i know what I'm doing yo! LOL
Okay, first make a button and give it the instance name "reset". Also make a MC (Movie Clip) and give it the instance name "zapper", and finally make a ball,guy,bug,poop,tomato etc., and give it the instance name "bug", and only "bug", "zapper", and "reset" ok.
Now give the bug these actions......
onClipEvent (mouseDown) {
startDrag("", true, 4, 7, 400, 550);
}
onClipEvent (mouseUp) {
stopDrag();
}
onClipEvent (load) {
initx = _x;
inity = _y;
_root.reset.onRelease == function () {
zapped = false;
_x = initx;
_y = inity;
alpha = 100;
_rotation = 0;
};
}
onClipEvent (enterFrame) {
if (_root.zapper.hitTest(_x, _y, true)) {
stopDrag();
zapped = true;
_root.zapper.play();
}
if (zapped) {
_y += 35;
zapped=false;
}
}
I'm pretty sure this works.
Once again I hope I helped!
Oh yeah one more thing!
Put stop(); on the first frame!!!!~
P.S.
You can also look in the tutorials for Flash MX
Search "zapper".
| » Level Intermediate |
|
|
Added: : 2004-10-07
Rating: 1.00 Votes: 3
Hits: 160
|
| » Author |
|
Pooches Gamin
|
| » Download |
|
Download the files used in this tutorial.
|
|
Download (0 kb)
|
|
Get conversion and unzipping tools
for PC and Mac here!
|
| » Forums |
|
More help? Search our boards for quick answers!
|
|
Please rate this tutorial, 10 is the top rating, you can also click the
comments link to read/write a review.
|
|
|