lundi 23 novembre 2015

error with hitTestObject AS3

in this TimerEvent I am trying to have the stars bounce off an object in the middle of the screen and I get this error TypeError: Error #1006: value is not a function. at ULTIKARLKATCHERV2_fla::MainTimeline/tickTock() at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick() Help!

function tickTock(e:TimerEvent) {

for(var i:int = 0; i < people; i++) {

stars[i].x += xInc[i] ;
stars[i].y += yInc[i] ;
stars[i].rotation += 15 ;
if (stars[i].x >= 500 || stars[i].x <= 0) {
    xInc[i] *= -1
}else if (stars[i].y >= 375 || stars[i].y <= 0) {
    yInc[i] *= -1
}
if (stars[i].x.hitTestObject(balance)){
        xInc *= -1
    }
}

} (This is for my ICS4 Class and I need a 100% pls help

Aucun commentaire:

Enregistrer un commentaire