PDA

View Full Version : Counting events


luka66_6
06-05-2008, 10:00 PM
Hi

I have a beginner question again. :) I am trying to count an event (it is hitTestObject event) and display number of hits in a text field.

so far i am here:
But how do i show this in a text field? I tried like this and it does not work.

var counter:int = 0;
var countHit:int = counter ++;
if(palca_mc.hitTestObject(tarca_mc))
{
counter ++;
countText_mc.text = countHit + " Hitted "
}
I searched forum for ideas without any sucess. Help is much appreciated.

luka66_6
06-05-2008, 10:28 PM
I got it. I got it. :)

it is:

var counter:int = 0;

if(palca_mc.hitTestObject(tarca_mc))
{
counter ++;
countText_mc.text = counter + " Hitted "}

I know you know but i did not, but i do now. :)