Jump to content
GreenSock

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

Tween Align

Recommended Posts

I'm aware that TweenAlign.START requires a  plugin etc.. but i've only seen material resolving the issue for (AS*).

 

Where can I find the plugin to allow TimelineMax.insertMultiple to accept TweenAlign.START as an argument?

 

 

 

Link to comment
Share on other sites

In actionscript, TweenAlign is just there to provide a shortcut to access some constants that return the alignment strings.

 

In javascript, there are no constants (well at least if you are supporting IE), plus the entire 'program' of GSAP needs to be instantiated on every page load, plus the total byte count of the .js files matters when it's being transferred over the internet, so TweenAlign was left out as it's not super important and would just add extra overhead when there aren't that many options anyway (please correct me if I misunderstood this Jack). You can just replace TweenAlign.TYPE with the returned string values: "sequence", "start", and "normal" (the default).

 

If you absolutely need to have TweenAlign, just paste the following somewhere in your page before you use TweenAlign the first time, and TweenAlign should work as you expect:

window.TweenAlign = {
  NORMAL: "normal",
  SEQUENCE: "sequence",
  START: "start"
};

For your reference: the code for actionscript TweenAlign:

public class TweenAlign {
  public static const NORMAL:String = "normal";
  public static const SEQUENCE:String = "sequence";
  public static const START:String = "start";
}
.
  • Like 1
Link to comment
Share on other sites

In addition to what Jamie said, in V12 insertMultiple has been replaced with add()

 

To add multiple tweens:

 

 

 

add 3 tweens at a time of 0, with start times staggered by 0.5 seconds
tl.add([tween1, tween2, tween3], 0, "stagger", 0.5);
 

Check out the docs to learn more about the position property which allows you to add your tweens at an absolute position (similar to insert/insertMultiple) or at a relative position (similar to append/appendMultiple)

 

http://api.greensock.com/js/com/greensock/TimelineLite.html#add()

  • Like 2
Link to comment
Share on other sites

Thanks "carl schooff" & "jamiejefferson",

 

Problem Solved.

Link to comment
Share on other sites

In addition to what Jamie said, in V12 insertMultiple has been replaced with add()

 

To add multiple tweens:

 

 

 

add 3 tweens at a time of 0, with start times staggered by 0.5 seconds
tl.add([tween1, tween2, tween3], 0, "stagger", 0.5);
 

Check out the docs to learn more about the position property which allows you to add your tweens at an absolute position (similar to insert/insertMultiple) or at a relative position (similar to append/appendMultiple)

 

http://api.greensock.com/js/com/greensock/TimelineLite.html#add()

 

 

 

In actionscript, TweenAlign is just there to provide a shortcut to access some constants that return the alignment strings.

 

In javascript, there are no constants (well at least if you are supporting IE), plus the entire 'program' of GSAP needs to be instantiated on every page load, plus the total byte count of the .js files matters when it's being transferred over the internet, so TweenAlign was left out as it's not super important and would just add extra overhead when there aren't that many options anyway (please correct me if I misunderstood this Jack). You can just replace TweenAlign.TYPE with the returned string values: "sequence", "start", and "normal" (the default).

 

If you absolutely need to have TweenAlign, just paste the following somewhere in your page before you use TweenAlign the first time, and TweenAlign should work as you expect:

window.TweenAlign = {
  NORMAL: "normal",
  SEQUENCE: "sequence",
  START: "start"
};

For your reference: the code for actionscript TweenAlign:

public class TweenAlign {
  public static const NORMAL:String = "normal";
  public static const SEQUENCE:String = "sequence";
  public static const START:String = "start";
}
.

You guys are Amazing, I really appreciate the help and love the thought of having TweenMax revolutionize the Web.

 

Any chance of an IRC channel available or being setup so the community can bounce idea's / problems and solutions around a bit more freely? 

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