Jump to content
Search Community

Possible bug in TimelineMax with TweenMax.allto()

protoemocional test
Moderator Tag

Recommended Posts

Hello good people,

 

I've spent almost two afternoons trying to solve this simple problem, checking multiple times for every item involved.

I'm using a TimelineMax variable (t1) instanced in the class constructor, which is supposed to do a sequence whenever a mouse CLICK event triggers a dclick function.

The problem comes only when I use TweenMax.allTo() inside a Timeline; if outside it behaves properly. Now, the defacto sequence does occur, but the AS3 Output window gives me this:

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at com.greensock::TimelineLite/insert()

at com.greensock::TimelineLite/insertMultiple()

at Exo/dclick()

at Exo/CLICK()

 

 

The code is this:

private function dclick(r:Number):void {
	           ti.insertMultiple([TweenMax.to(mc1, r, {y:300, yoyo:true}),
		                          TweenMax.allTo(mc_array, r, {tint:0xFFFFFFFF}, 0.3)], 
		                          0, TweenAlign.SEQUENCE, 0.1);
	}

 

Please help me....

Link to comment
Share on other sites

TweenMax.allTo() (and allFrom() and allFromTo()) returns an Array! Your code is nesting that inside another Array which breaks things.

 

BAD: timeline.appendMultiple([tween1, tween2, TweenMax.allTo(...)]);

GOOD: timeline.appendMultiple(TweenMax.allTo(...));

-OR-

timeline.appendMultiple(TweenMax.allTo(...).concat([tween1, tween2]));

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