Jump to content
Search Community

Problem with TimelineMax and SplitTextField

stenrap test
Moderator Tag

Recommended Posts

Hi all,

 

First post...just became a shockingly green member. I'm trying to add a TweenMax.allFrom() tween on a SplitTextField object to a TimelineMax, and I'm running into a compiler error. Here's my code:

 

var welcomeToTextSplit:SplitTextField = new SplitTextField(welcomeToText);
var welcomeTimeline:TimelineMax = new TimelineMax();
welcomeTimeline.append(TweenMax.allFrom(welcomeToTextSplit.textFields, 1.5, {transformAroundPoint:{point:new Point(ovidSetupBotText.x + ovidSetupBotText.width + 5, ovidSetupBotText.y), scale:0.0}, delay:0.5, ease:Strong.easeOut}));

 

And here's the compiler error:

 

Error: Implicit coercion of a value of type Array to an unrelated type com.greensock.core:TweenCore.
welcomeTimeline.append(TweenMax.allFrom(welcomeToTextSplit.textFields, 1.5, {transformAroundPoint:{point:new Point(ovidSetupBotText.x + ovidSetupBotText.width + 5, ovidSetupBotText.y), scale:0.0}, delay:0.5, ease:Strong.easeOut}));                                                                                                                                                                    ^

Any ideas what I'm doing wrong?

Link to comment
Share on other sites

Got it sorted out. Since the append() method expects a single tween, you can't use it to tween an array of objects (such as an array of split textfields). Instead, you need to call appendMultiple(). I was thrown off by the fact that the output of the compiler error was wrapping to a new line, so it looked like the caret was pointing to the delay parameter:

 

delay:0.5
^

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...