Jump to content
Search Community

TweenMaxVars.startAt bug [SOLVED]

bas test
Moderator Tag

Recommended Posts

hi i found a possible bug with TweenMaxVars (version 5.1) and the startAt method. The generated object in the vars property contains a repeatDelay property while utilizing the startAt method, not - as one would expect - an startAt property.

 

consider the following

 

vars = new TweenMaxVars().prop('z', 0).startAt(new TweenMaxVars().prop('z', -200)).vars;
trace(ObjectUtil.toString(vars));

(Object)#0
 repeatDelay = (com.greensock.data::TweenMaxVars)#1
   isGSVars = true
   vars = (Object)#2
     z = -200
 z = 0

 

change in data.TweenMaxVars

public function startAt(vars:TweenMaxVars):TweenMaxVars {
    return _set("repeatDelay", vars);
}

to

public function startAt(vars:TweenMaxVars):TweenMaxVars {
    return _set("startAt", vars.vars);
}

and the vars object is what is expected

trace(ObjectUtil.toString(vars));
(String) = (Object)#0
 startAt = (Object)#1
   z = -200
 z = 0

Link to comment
Share on other sites

cool - thanks - however

 

i still get an exception, it seems because vars is an instance of TweenMaxVars

 

ReferenceError: Error #1037: Cannot assign to a method overwrite on com.greensock.data.TweenMaxVars.
at com.greensock::TweenMax/init()[/users/bas/Documents/Adobe Flash Builder 4.5/FlexBased/src/com/greensock/TweenMax.as]
at com.greensock::TweenMax/renderTime()[/users/bas/Documents/Adobe Flash Builder 4.5/FlexBased/src/com/greensock/TweenMax.as]
at com.greensock::TimelineMax/renderTime()[/users/bas/Documents/Adobe Flash Builder 4.5/FlexBased/src/com/greensock/TimelineMax.as]
at com.greensock.core::SimpleTimeline/renderTime()[/users/bas/Documents/Adobe Flash Builder 4.5/FlexBased/src/com/greensock/core/SimpleTimeline.as]
at com.greensock::TweenLite$/updateAll()[/users/bas/Documents/Adobe Flash Builder 4.5/FlexBased/src/com/greensock/TweenLite.as]

which originates from in TweenMax.as

override protected function init():void {
		if (this.vars.startAt) {
			this.vars.startAt.overwrite = 0;

 

my suggested patch was to extract the anonymous vars object from the TweenMaxVars instance before calling the _set method... That solves it, but perhaps it could be done differently...

 

suggested change (works for me):

public function startAt(vars:TweenMaxVars):TweenMaxVars {
return _set("startAt", vars);
}

to

public function startAt(vars:TweenMaxVars):TweenMaxVars {
return _set("startAt", vars.vars);
}

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...