gskinner / gskinner/GTween

GTweenTimeline - gotoAndPlay() not working properly if used before animation has fully played.

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
ActionScript
Stars
11
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm using GTween v2.01. I've created a GTweenTimeline and added several tweens to it.

If I use "paused = false" to start the animation, everything goes fine. But if I use "gotoAndPlay()" to start the animation from x seconds (eg: timeLine.gotoAndPlay(5);), The tween positions gets all messed up.

The call to "gotoAndPlay()" works fine after the animation has played completely, but not if called when the animation hasn't played the first time.

I have attached a small test. You can try the different behaviour by starting the animation with either "timeLine.paused = false;" or "timeLine.gotoAndPlay(playFrom);"

[gtween_test.zip](https://github.com/gskinner/GTween/files/902477/gtween_test.zip)

After debugging, I've found that if I change GTweenTimeline.as, line 115 from:
if (rev) {
to:
if (!rev) {
The animation works perfectly.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.