Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

TweenMaxVars startAt typecasting bug?

Recommended Posts

A possible exists in TweenMaxVars line 62:


public var startAt:TweenLiteVars;


The documentation specifies that this property accepts Object types and the example uses short object notation. However, since the property requires type TweenLiteVars, this usage is not possible: 1118: Implicit coercion of a value with static type Object to a possibly unrelated type com.greensock.data:TweenLiteVars.


If it's the case that this property must use TweenXVars, and the docs are just out of sync, then nevermind!


Thanks for a great Tweening platform!



Link to comment
Share on other sites

Nope, it's not a typo. Anyone who is using TweenMaxVars must be concerned about strict data types and/or code hinting, so the startAt should be a TweenLiteVars object (it doesn't need to be TweenMaxVars because a TweenMaxVars extends TweenLiteVars). It sounds like you're getting the error because you're trying to use a generic object instead of a TweenLiteVars object for startAt which defeats the purpose of using the class in the first place :) See what I mean? Or did I misunderstand your question?

Link to comment
Share on other sites

Ok, that makes perfect sense. I was confused because the documentation reads:

Simply pass an object in with whatever properties you'd liketo set just before the tween begins. For example, if mc.x is currently 100, and you'd like to tween it from 0 to 500, do TweenMax.to(mc, 2, {x:500, startAt:{x:0}});


But I think this is just a carryover from the regular startAt property (not the TweenMaxVars property).



Link to comment
Share on other sites

Oh, great point - I'll correct that blurb in the docs. I can see why it would sound confusing. You're right - that was a copy/paste from the regular TweenMax docs. :)

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.