I guess in my last thread I wasn’t specific enough.
Allright, so here’s the problem. Many of you know the gravitation tutorial on the site. I applied this to a series of movieclips (text characters converted to symbols), each placed at a different point of time in the timeline. The trouble is, the movement is irregular and stops in places, and basically the effect is not working. The code used on the movieclips is exactly the same as the final piece of code given in the tutorial, which is this:
onClipEvent (load) {
gravity = 2 ;
// We get the time when the ball is released for the
// first time. Be careful with the division by 100
time = getTimer () ;
time /= 100 ;
floor = 500 ;
bounce = 0.92 ;
// We set the speed of the ball when it is released.
speedx = 0 ;
speedystart = 0 ;
}
onClipEvent (enterFrame) {
// We get the current time (still /100)
timenow = getTimer () ;
timenow /= 100 ;
speedy = gravity * (timenow - time) + speedystart ;
//We move the ball
this._x += speedx/5 ;
this._y += speedy/5 ;
if (this._y > floor) {
this._y = floor ;
speedy *= -bounce ;
time = getTimer () ;
time /= 100 ;
// reset the timer
speedystart = speedy ;
// reset the starting speed
}
}
Here’s a screenshot of the part of the timeline involving the 3 movieclips. The layer names correspond with the text character inside the movieclip, so its “Z” “E” and “N”.