PDA

View Full Version : please help with detection


handle
03-08-2005, 06:19 PM
i have this elastic tween going on it completely works fine but i just want to go to another function once the mc gets settled into place... anyone know how i can do this and what type of variable do i need any help would be appreciated

function tweenLoader() {
var k:Number = .8;
var damp:Number = .6;
var ty:Number = 215;
var vy:Number = 0;
var ay:Number = 0;
_root.myMC.onEnterFrame = function() {
ay = (ty-_root.begProgLoader._y)*k;
vy += ay;
vy *= damp;
_root.myMC._y += vy;
****if statement goes here****??
};
}


i know how to get out of the loop by making if statement but if i say for example if (vy<1){
nextfunction()
}
th MC will stop right away instead of bouncing back and forth

webguy
03-08-2005, 06:26 PM
// guessing ty is the ending y position
if(this._y == ty) {
callAnotherFunction();
delete this.onEnterFrame;
}

handle
03-08-2005, 06:37 PM
i feel so stupid it was in front of me the whole time thanx aagin webguy