Jump to content
Search Community

LLCoolGirl

Members
  • Posts

    3
  • Joined

  • Last visited

LLCoolGirl's Achievements

0

Reputation

  1. You spare no effort to help me, so thank you so much, Jamie. I must admit, the code I posted was not complete as I left out: var pos_old:Number = hitarea.right_arrow.x; var pos_new:Number = hitarea.right_arrow.x+50; Thought it wouldn't make any difference and didn't check it out 'cause I'm used to initiate the vars outside. So arrow_2 was my choice
  2. Thank you for your quick responses. I tried out your code Jamie, but it doesn't work, even with invisible button. Tweening didn't get fired or just sometime. And if I hovered the mouse very quickly many times on the inv_btn, the tweening happens as many times as the mouse was over!! Putting var tl:TimelineLite = new TimelineLite(); outside the btn_over-function was good, but I had to put the tl.append(TweenLite ... inside btn_over-funtion, otherwise nothing would happen. Because it didn't work, I changed the code and only using TweenLite w/o TimelineLite. Now it works great. Here's the very simple code: hitarea.buttonMode = true; inv_btn.mouseChildren = false; inv_btn.addEventListener(MouseEvent.ROLL_OVER, btn_over); inv_btn.addEventListener(MouseEvent.ROLL_OUT, btn_out); function btn_over(e:MouseEvent):void { TweenLite.to(right_arrow, 0.8, { x:right_arrow.x+50, scaleX:2.5, scaleY:2.5, ease:Elastic.easeOut }); } function btn_out(e:MouseEvent):void { TweenLite.to(right_arrow, 0.5, { x:right_arrow.x, scaleX:2, scaleY:2, ease:Elastic.easeOut }); } PS: And yes, Carl, relative Number caused problems in this case. And the inv_btn (normally I always use inv_btn ) is also the solution. But one last thing. You misunderstood the problem I had with "Roll_out not registered". When the tweening is still running, and I go out with the mouse, the btn expected me to go out "once again" as soon as the tweening has ended. That means: if I go back on the btn, no "roll_over" happens until I go out and NOW the "roll_out" has been fired out. So I had to wait until the tweening ends and then go out off btn, or have to go over btn twice in order to fire out "roll_over"-event :/
  3. Hello Carl @ snorkl.tv or anyone who could help in your reply on the a.m. topic you wrote: So what then is the solution? In my following code I have to make the trick with onComplete --> out function. If I didn't, then the mc jumps further and further as you wrote. But still the whole stuff doesn't work fine. When I roll out during the tween is still running, then rollOut is of course not registered. Is there an elegant way to solve this? Thanx in advance for your help! right_arrow.buttonMode = true; right_arrow.mouseChildren = false; right_arrow.addEventListener(MouseEvent.ROLL_OVER, btn_over); function btn_over(e:MouseEvent):void { e.currentTarget.removeEventListener(MouseEvent.ROLL_OVER, btn_over); var tl:TimelineLite = new TimelineLite({onComplete:out}); tl.append(TweenLite.to(e.currentTarget, 0.8, { x:"+50", scaleX:2.5, scaleY:2.5, ease:Elastic.easeOut }) ); tl.append(TweenLite.to(e.currentTarget, 0.5, { x:"-50", scaleX:2, scaleY:2, ease:Elastic.easeOut }),-0.3 ); } function out():void { right_arrow.addEventListener(MouseEvent.ROLL_OUT, btn_out); } function btn_out(e:MouseEvent):void { e.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, btn_out); e.currentTarget.addEventListener(MouseEvent.ROLL_OVER, btn_over); }
×
×
  • Create New...