Jump to content
GreenSock

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

tlpann

Members
  • Posts

    8
  • Joined

  • Last visited

tlpann's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Here is the .fla file. Thank you! gsap_forum_example.zip
  2. This allows exactly one additional rotation in the left direction. Then it stops again. I changed it to myTween.time(3600000).pause() and have the same outcome.
  3. P.S. I considered using a single tween and just reversing it, but it stops when it gets to 0. If it's better to use reverse() then I would love advice about how to make it continue beyond 0.
  4. Hello, I have tried and failed to figure out how to do this: I have an arrow (Sprite) that I want to rotate right continuously when I press the right arrow, and likewise left for the left arrow, and stop when I release the key. Here is my code: private var arrowRight:TweenMax; private var arrowLeft:TweenMax; // ... arrowRight = new TweenMax(arrow, 3, {rotation:360, repeat:-1, ease:Linear.easeNone, paused:true}); arrowLeft = new TweenMax(arrow, 3, {rotation:-360, repeat:-1, ease:Linear.easeNone, paused:true}); stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased); private function keyPressed(k:KeyboardEvent):void { if (k.keyCode == 39) { arrowRight.play(); } else if (k.keyCode == 37) { arrowLeft.play(); } } private function keyReleased(k:KeyboardEvent):void { if (k.keyCode == 39) { arrowRight.pause(); } else if (k.keyCode == 37) { arrowLeft.pause(); } } The problem with this (as you probably would guess) is that if I first press RIGHT, then when I release and press LEFT, the arrow rotates left until it gets to rotation=0, then jumps to the rotation value that it was at when I released RIGHT. If I hold LEFT down, it does the jump every time it hits rotation=0. How do I fix this so that rotation starts and continues seamlessly in either direction? Thanks! Tim
  5. Hello, I'm new to GSAP and have only begun to use it so this will probably be a pretty simple question. I didn't know what terms to search on, but it's probably been asked in the past. I am using a for loop to create a set of training module display objects (ModuleWindow). They all contain unique content, and they all must start out offscreen, at y=stage.stageHeight+10. When the user clicks a menu button, the appropriate module needs to tween up so it's visible, and whatever one is visible needs to go back down (reverse). All I know how to do at the moment is create a TweenMax instance using .to, and that of course causes the display object to begin tweening immediately. So clearly this won't work: for (var i:int = 0; i < contentArray.length; i++) { var module:ModuleWindow = new ModuleWindow(contentArray[i]); addChild(module); module.y = stage.stageHeight + 10; var moduleTween:TweenMax = TweenMax.to(module, 0.5, {y:10}); } ...because I want each module to stay put until the appropriate button is clicked to bring it up. What I want to do is create a TweenMax instance that I can associate with each module (hopefully by assigning it as a get/set property of the module, such as module.tweenUpDown) and then invoke each module's TweenMax instance whenever I want. How do I do that? Thank you!
  6. Hello, I'm new to this forum. I apologize in advance if this question has been answered -- I'm brand new to TweenMax and (perhaps unwisely) trying to use it in a project that needs to be done very soon. I am using TweenMax to make a message box appear with contextual information. Certain user actions cause the message box's text to change, then the box appears, remains for 3 seconds, then disappears. My limited knowledge of TweenMax enables me to do this (code is simplified): // mouse over buttons and get two different messages msgBox.addMessage("This button is disabled."); // message 1 msgBox.addMessage("Click this button to open the control panel."); // message 2 function addMessage(msg:String):void { box.text = msg; myTween = TweenMax.to(box, 0.3, {alpha:1}); TweenMax.delayedCall(3, startReverse); } function startReverse():void { myTween.reverse(); } This works nicely until the next bit of functionality comes into play: Say the user mouses over button 1, then quickly mouses over button 2 while the message for button 1 is still visible. I want to interrupt the delayed call, make message 1 fade immediately, and then call addMessage for message 2. Is/are there TweenMax methods that enable a graceful and simple way to do this? Thank you, Tim
×