Flash MX going wild

Does anybody know what’s wrong with this?
look at the score, it’s just going wild…

hehe… u had a typo

change this

[AS]
onClipEvent (enterFrame) {
if (_root.bom, hitTest(_root.chalethuis)) {
_root.score = _root.score +1 ;

}

}
[/AS]

to

[AS]
onClipEvent (enterFrame) {
if (_root.bom.hitTest(_root.chalethuis)) {
_root.score = _root.score +1 ;

}

}
[/AS]

and btw… thats not going to hitTest anytime cause you are testing the hitTest with _root.bom… but that always stays to the side. Only duplicatrwes of it fall… and the duplicates have other names…

so what you need to do is have a for loop and check for hittest with _root[“bom”+ i]. This will however slow down the game if u have lots of duplicates made. A tip is to remove the bomb movie clip (removeMovieClip()) after it reaches the bottom and subtract one from bombCounter…

-Aditya
:thumb:

Hmmmmmmmm… I don’t quite get it. How would you do that?

Anyone???

Something like this, but it doesn’t work ?:

onClipEvent (load) {

bomMoveSpeed=20;
this._x=_root.vliegtuigje._x;
this._y=_root.vliegtuigje._y+10;

}

onClipEvent (enterFrame) {

this._y+=bomMoveSpeed;
if (this._y>400){
this.removeMovieClip();
_root.bomCounter = _root.bomCounter -1;

}

}

You would make a function i think and do somethin like:
_root[“bom”+i] = whatever-function

the function would tell it to remove a movieclip when it reaches the bottom of the stage…

But how would that solve the hitTest problem?

PS hittesting with _root[“bom”+i] doesnt work either with me?

Whats the hitTest problem??! Sorry i only skimmed the above so i don’t have much of an idea of whats goin on :-\

Well , since you drop COPIES of _root.bom all the time , it’ll never hitTest with _root.bom !
(See .fla)

Anyone …

*Originally posted by adityagaddam *

so what you need to do is have a for loop with _root[“bom”+ i].
-Aditya
:thumb: **

What do you mean by that?

what he means is when you duplicate the boms, they will all have the name _root[“bom”+i]…and so he is saying using the ‘for’ command or whatever (you can look it up in the AS dictionary)…put the hitTest thing in there and so it removes boms when it reaches the bottom of the stage. Get it?!

Yes, that’s the way to remove the MC’s but how do you make them detect collision with “chalethuis”?

hitTest…

if (_root[“bom”+i], hitTest (chalethuis)) {
blah blahblah
}

I’m sorry but I already tried that. That seemed very simple , but it doesnt work…

Anyone??? HELP!

Help, I really don’t know what to do, though it seems so simple.

HELP!

Anyone?