Nooby
11-05-2007, 06:24 PM
Hi guys i been trying to achieve a very basic game where a movieclip follows the mouse and when the user clicks on the movie clip it tests whether or not the movieclip is over the target movie clip and trace out a message as to whether you hit the target or not, Now when i try to trace out the value of Bshoot is says undefined but i cannot see where its undefined. I am quite new to AS so please be kind :P
Movie Contents : 3 Layers
Actions :
mcTarget
mcCursor
Now the code i have placed in mcCursor is
onClipEvent (load) {
startDrag(this, true);
Mouse.hide();
}
onClipEvent (mouseDown) {
var Bshoot:Boolean
Bshoot = mcCursor.hitTest(mcTarget);
if(Bshoot){
trace("Hit Target");
} else {
trace(Bshoot)
trace("Missed");
}
}
Code placed in Actions :
stop();
Mouse.hide();
Many Thanks Noob :)
Movie Contents : 3 Layers
Actions :
mcTarget
mcCursor
Now the code i have placed in mcCursor is
onClipEvent (load) {
startDrag(this, true);
Mouse.hide();
}
onClipEvent (mouseDown) {
var Bshoot:Boolean
Bshoot = mcCursor.hitTest(mcTarget);
if(Bshoot){
trace("Hit Target");
} else {
trace(Bshoot)
trace("Missed");
}
}
Code placed in Actions :
stop();
Mouse.hide();
Many Thanks Noob :)