Share Posted July 2, 2013 Does any body know why this is not working? (action script 2) var pictures: Array = new Array (pictures.p1, pictures.p2, pictures.p3); button.onPress = function () {animatepictures.tween.play(); } animatepictures.tween = TweenMax.allTo (pictures, 2, {_x:"50", _y:"50", paused:true }, 0.1); By the way, i need to concatenate a "this" with a string, is it possible? example: name.target.onPress = function () { this+"whatever".tween.play(); } Link to comment Share on other sites More sharing options...
Share Posted July 2, 2013 The problem is that allTo() creates an array that is filled with tweens, not a single tween that can be controlled via play(), reverse(), pause() etc. The v11 docs show how to insert allTo tweens into a timeline so that you can control them with those methods: http://www.greensock.com/as/docs/tween/com/greensock/TweenMax.html#allTo() So in your case you could do something like this in v11: btn.timeline = new TimelineLite({paused:true}); btn.timeline.insertMultiple(TweenMax.allTo([mc1, mc2], 1, {_alpha:0, _y:"100"}, 0.1)); btn.onPress = function() { this.timeline.play(); } Better yet, use the TimelineLite staggerTo() method in v12 btn.timeline = new TimelineLite({paused:true}); btn.timeline.staggerTo([mc1, mc2], 1, {_y:200}, 0.2) btn.onPress = function() { this.timeline.play(); } Link to comment Share on other sites More sharing options...
Author Share Posted July 2, 2013 Thanks carl ! 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