local rect4 = display.newRect( 0, 0, 50, 50) rect4:setFillColor( 255,0,0 ) rect4:addEventListener( "touch", tr1 ) function tr1 (event) local counter = 0 transition.to( rect4, {time=1000, alpha=0, x=w-50, y=h-50 }) transition.to( rect4, {time=2000, delay= 1200, alpha=1.0, x=50, y=50 }) counter = counter + 1 label1.text =counter end
can someone tell me why this gives nil:nil error for the eventlistener? I just tried to run the tr1 when I clicked on rect4.