PDA

View Full Version : dynamic text


omega10mg
08-24-2003, 07:32 PM
onClipEvent (enterFrame) {
if (this.hitTest(_root.boll))
_root.test.text + 1
}

thats my code.. and it is supposed to + 1 in the dynamic text field test each time the MC boll hits mark (thats the MC the code is on)

what is wrong.. how do i do this correct?
propartly realy easy.. but i am not so good. ;)

chris-sharpe99
08-24-2003, 08:46 PM
Not very good with this sort of stuff, but you haven't got your condition testing anything. It does a hit test, but you haven't told it to continue if it has hit or if it hasnt hit. Dunno if that helps, but its all I can really see wrong with it.
Chris

Natalia
08-24-2003, 09:35 PM
Here's a counter thing I made that might help (I know for sure that the counter is incrementing, paste the code and have a dynamic text field on the stage named playText_txt, have a 0 in it to start (or you can do that in the code))... I added the countStop function to stop the enterframe from continually running when it doesn't need to... You'll need to change this to work with your needs (I don't know exactly what you're trying to do without seeing the file)


countUp = function () {
this.onEnterFrame = function() {
if (Number(playText_txt.text)<20) {
playText_txt.text++;
} else {
countStop();
}
};
};
countStop = function () {
this.onEnterFrame = function() {
undefined;
};
};
countUp();