I’m using Action Script 3 to make android game using “air for android”
I make a ball, gole and StatusTxt.
and i have end every thing in the design Correctly.
in the Code:
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
ball.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchBegin);
ball.addEventListener(TouchEvent.TOUCH_END, onTouchEnd);
function onTouchBegin(e:TouchEvent) {
e.target.startTouchDrag(e.touchPointID);
}
function onTouchEnd(e:TouchEvent) {
e.target.stopTouchDrag(e.touchPointID);
}
if(gole.hitTestObject(ball))
{
StatusTxt.text = "You hit it.";
}
but the StatusTxt has not changed Why??
Your test is outside the event. You could add it in the
onTouchEndfunction. If you want to test it outside of theTOUCH_ENDevent you could use aENTER_FRAMEevent.So it would end up looking something like this:
or with the
ENTER_FRAMElike this: