alright, well im making a game and for some reason im faced with this problem.
i have a class
a = function () {
};
a.prototype.a = false;
a.prototype.b = false;
a.prototype.c = false;
a.prototype.d = false;
in part of the code i use a for loop to attach some movie clips that are to be hittested by the main character
for (i=0; i<=a; i++) {
_root.attachMovie(“x”, “x”+y, y+1000000000);
_root[“x”+y]._x = something;
_root[“x”+y]._y = something;
_root[“x”+y] = new a();
_root[“x”+y].a = true;
}
at the end of the code i run another for loop to cycle through the movie clips i attached and in that for loop i hittest the character against them
for (i=0; i<=numberofmovieclips; i++) {
if (_root.char.hitTest(moveiclips) == true){
trace(“test”)
}
now, if i leave out the line
_root[“x”+y] = new a();
then the hittests work fine and result in a test being traced, but if i leave it in the hittests wont work…
that is my problem… why the hell doesnt it work.
oh, and if i put the class declaring line in before the x and y properties of the movieclips are set, then the movieclips x and y properties wont get set, like so
for (i=0; i<=a; i++) {
_root.attachMovie(“x”, “x”+y, y+1000000000);
_root[“x”+y] = new a();
_root[“x”+y].a = true;
_root[“x”+y]._x = something;
_root[“x”+y]._y = something;
}
so someone please explain what im doing wrong, thanks