Alright, I’m finally trying to get my chops together with AS 3.0 and make everything its own class. I make mainly games, and I’m having a hard time figuring out how to hitTest 2 instances of separate classes.
In this case, I’ve got a Bomb class and a Dinosaur class that I instantiate using functions as follows (The user drops bombs which fall onto the Dinosaurs):
function dropBomb() {
var bomb:Bomb = new Bomb();
addChild(bomb);
}
function makeDinosaur(evt:TimerEvent) {
var newDino:Dinosaur = new Dinosaur();
addChild(newDino);
}
The classes handle their respective animations, but when I try to use HitTest on the main timeline, it doesn’t recognize “bomb” or “newDino” because they’re inside of functions. Does anyone know how to do this?
Thanks,
Haig