Jump to content
Search Community

Henry last won the day on December 22 2012

Henry had the most liked content!

Henry

Members
  • Posts

    9
  • Joined

  • Last visited

  • Days Won

    1

Henry last won the day on December 22 2012

Henry had the most liked content!

Henry's Achievements

1

Reputation

  1. Hallo Greensock Thanks for the insider information about the _gsTransform object. For a moment I thought it was a joke because the solution was so obvious... Consider this topic as closed. Have a nice Christmas! Henry
  2. .... hang on - it is much easier! // -- var dispObj = // any object var myTween = ThrowPropsPlugin.to(dispObj, ... //what ever you tween myTween.time( myTween.duration() ); // make a time jump to the future var endX = dispObj.x; // ask your object where it is myTween.time(0) // go back in time // -- This perfectly works. Okay I see - you where joking with you "super-secret place" - wheren't you? Have an animated Christmas and a tweening New Year! Henry
  3. Hello Greensock Thanks a lot for your replay. Perhaps I should not play around with this time-paradox-thing on doomsday (12/21/12) but I was too curious... I've tried both ways and it works - a bit. The second one seems to work for simple ThrowProps even without a fixed time like this: // -- var xVelocity = ... // some calculatetd value var dispObject ... // some object, EaselJS DisplayObject in my case var myTween = ThrowPropsPlugin.to(dispObject, {throwProps:{x:xVelocity}, ease:Sine.easeOut}); var endX = dispObj.x + ThrowPropsPlugin.calculateChange(xVelocity, Sine.easeOut, myTween.duration() ); // -- However my code has a few more parameters and looks like that: // -- var myTween = ThrowPropsPlugin.to(dispObj,{ throwProps: { x:{velocity:xVelocity, min:0, max:640, resistance:120} }, ease:Sine.easeOut },5,0.2,0.4); // -- I have no idea how to put all of them into account. Therefore your first example looks like the better choice. But a couldn't access your "super-secret place" element._gsTransform.x; What is "element" ? The element I'm tweening? Wherever I try to get _gsTransform.x from - it causes an undefined error. Perhaps _gsTransform.x is too super-secret? Greetings Henry
  4. Dear Greensock How is it when I publish a Javascript animation using the ThrowPropsPlugin? I would make "members only" code easily available for everyone. Is this okay with you? Flash was a sort of "closed". But there isn't very much one can do with JS files. Greetings Henry
  5. Hello everybody I'm testing the ThrowPropsPlugin. It works like a charm so far. However, I I've come a case where I would like to know my final properties in advance. Is there a chance to retrive the end values of x,y, or rotation onstart of a tween? (Or will this cause a temporal paradox that crashes the universe?) Greetings Henry
  6. Hello Jack It perfectly works now. Thanks for fixing this so quickly. Henry
  7. Hello and thanks for your quick reply. I used TweenMax.js. According to the documentation the plugin would be included. I just run a test with RoundPropsPlugin.js loaded as well. But it makes no difference. Well - a small difference: The error comes from RoundPropsPlugin.js now. ( Uncaught ReferenceError: _tween is not defined, line:56, Tested in Firefox and Chrome ) Your answer sounds like it should work? I reduced my code to the following copy/paste example. Perhaps it helps to find out what I'm doing wrong: <!doctype html> <html> <head> <title>RoundProps Test</title> <meta charset="utf-8" /> <script type="text/javascript" src="http://www.greensock.com/js/src/TweenMax.min.js"></script> <script type="text/javascript"> //<![CDATA[ var _obj = {v:0}; TweenMax.to(_obj, 1, {v:100, roundProps:"v", ease: Linear.easeNone, onUpdate:onTweenUpdate}) function onTweenUpdate () { console.log(_obj.v) } //]]> </script> </head> <body> </body> </html> Greetings Henry
  8. Hello I'm trying to tween a value of an object like this: var _obj = {v:0}; TweenMax.to(_obj, 1, {v:100, ease: Linear.easeNone, onUpdate:onTweenUpdate}) } function onTweenUpdate () { console.log(_obj.v) } This works fine but what it actually needs are rounded values. I thought "roundProps" would come in handy but the following change causes an error in TweenMax.js: TweenMax.to(_obj, 1, {v:100, roundProps:"v", ease: Linear.easeNone, onUpdate:onTweenUpdate}) Is this code wrong or does "roundProps" not work that way? What I actually would like to do with it is tweening the "currentAnimationFrame" of an EaselJS BitmapAnimation. I used the "onTweenUpdate" function from the example above together with Math.round() as a workaround. But it would be much nicer to tween the currentAnimationFrame directly. Any ideas anyone? Cheers Henry
  9. Hi slayaz The most elegant way to solve this would be using TimelineMax. But you could also place an onComplete function at the end of your last tween. You just need to put the whole thing into a function: import com.greensock.*; startLoop() function startLoop():Void { TweenMax.allTo([imageone, imagetwo, imagethree, imagefour,imagefive, textone, texttwo, link, lookingforward], 0, {_alpha:0}); TweenMax.to(imageone, 2, {_alpha:100, delay:1}); TweenMax.to(imageone, 2, {_alpha:0, delay:5}); TweenMax.to(imagetwo, 2, {_alpha:100, delay:6}); TweenMax.to(lookingforward, 2, {_alpha:100, delay:7}); TweenMax.to(imagetwo, 2, {_alpha:0, delay:10}); TweenMax.allTo([imagethree, textone], 2, {_alpha:100, delay:11}); TweenMax.allTo([imagethree, textone], 2, {_alpha:0, delay:15}); TweenMax.allTo([imagefour, texttwo], 2, {_alpha:100, delay:16}); TweenMax.to(imagefour, 2, {_alpha:0, delay:20}); TweenMax.to(imagefive, 2, {_alpha:100, delay:21}); TweenMax.to(link, 2, {_alpha:100, delay:23}); TweenMax.allTo([imagefive, link], 2, {_alpha:100, delay:27}); // The last tween calls it again and again TweenMax.allTo([imagefive, link, texttwo], 2, {_alpha:0, delay:31, onComplete:startLoop}); } I hope it works
×
×
  • Create New...