Skip to main content
Inspiring
September 20, 2007
Answered

Stopping at specific y coordinate

  • September 20, 2007
  • 2 replies
  • 328 views
I have some graphics that I want to load into my flash file above the stage and then slide into the stage area the stage area. I am obviously new to actionscript, but I thought this would not be too difficult to figure out.

Here's what I have:

On the frame:

//load Graphic Behavior
this.id_error_mc.loadMovie("smart_qc/id_error.jpg");
//End Behavior

On the movieClip named id_error_mc

onClipEvent (enterFrame) {
if (this._y<3) {
this._y += 10;
}
}

This movieClip is set at y -300. I want it to drop down and to stop at exactly y 3. I comes close, but it's off by a few pixels. When I adjust the speed, it's off even more. When I adjust the coordinates it's still off. I suspect I am going about it all wrong, but I have not been able to find anything on the web or in my actionscript books that can help me solve the problem.
This topic has been closed for replies.
Correct answer kglad
:

2 replies

kglad
Community Expert
Community Expert
September 20, 2007
if you want to use actionscript easing, the easiest way is to use the tween class.
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
September 20, 2007
:

Inspiring
September 20, 2007
Thanks! That works, but it sort of bounces and does not have an ease in transition. I have to hit the books and learn some actionscript.