How i can use instance name outside of current object?I want to make when this object hit object with instance name – level1 to trace Hit
onClipEvent(load){
var gravity = 9.8;
var velocity = 0;
var fps = 24;
}
onClipEvent(enterFrame){
if (this.hitTest(level1)){
trace("Hit");
} else {
}
velocity = velocity+1/fps;
this._y += velocity*5;
}
You need to use “_root” as a parent… just like you have declared for your enter frame function.
Try changing the hitTest line to this: