Share Posted October 29, 2015 I've been catching back up with Flash Pro and Greensock using the new Canvas and WebGL file formats. One thing I noticed is when I try to use relative numbers with Greensock I get unexpected results. In AS3 I would have use something like this TweenLite.to(mc, 1, {x:"500"}); and the mc would have moved 500px to the right of where it was sitting on the stage. When I use the same piece of code in Flash Pro in JS instead of AS3 TweenLite.to(this.mc, 1, {x:"500"}); The mc seems to move to a location that is far more then 500px and not always in the direction that I thought it would move.. Since I'm using Flash Pro I'm not sure I can recreate this in codepen? Again this might be an issue with CreateJs and not GSAP. Link to comment Share on other sites More sharing options...
Share Posted October 30, 2015 I don't know how it worked in AS, but a string does not make it relative. Those values will be parsed into an absolute value. Try these... // Increase TweenLite.to(mc, 1, {x:"+=500"}); // Decrease TweenLite.to(mc, 1, {x:"-=500"}); 3 Link to comment Share on other sites More sharing options...
Author Share Posted October 30, 2015 Thanks didn't realize this! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now