Jump to content
Search Community

johnnyfortune

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by johnnyfortune

  1. Found the Answer a little deeper down the board. viewtopic.php?f=1&t=2180 If anyone is curious, I just set my var openTimeline to have the {Reversed:true, Paused:true, repeat:0, yoyo:true, overwrite:true} so the animation would load, but you wouldn't see it until the button is clicked. Then when its click again, the animation plays in reverse. An so on, forever, until you get tired and stop clicking it. http://www.inmomentmedia.com/files/PV3D.fla.zip function yellowclickHandler(event:MouseEvent):void { if (openTimeline.reversed) { openTimeline.play(); } else { openTimeline.reverse(); } }
  2. I think I figured out all the kinks, but Im still having one problem. Can you make one button, that when it's clicked it plays the timeline, then when its clicked again, the button play the timeline in reverse? btw sorry for not using these neat code boxes before. I didnt know. import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; import flash.events.MouseEvent; import flash.external.ExternalInterface; red_btn.addEventListener(MouseEvent.CLICK, clickButtonHandler); yellow_btn.addEventListener(MouseEvent.CLICK, yellowclickHandler); green.addEventListener(MouseEvent.ROLL_OVER, greenoverHandler); green.addEventListener(MouseEvent.ROLL_OUT, greenoutHandler); //GREEN BUTTON var myTimeline:TimelineMax = new TimelineMax({repeat:-1, yoyo:true, overwrite:false, paused:true}); myTimeline.insert( new TweenMax(asciitowel, 3, {y:-500, ease:Sine.easeInOut}) ); //GREEN BUTTON var myTimeline1:TimelineMax = new TimelineMax({paused:true, repeat:-1, yoyo:true, overwrite:true}); myTimeline1.insert( new TweenMax(paper, 1, {y:200, ease:Quad.easeOut}) ); myTimeline1.insert( new TweenMax(rainbow, 3, {y:250, ease:Elastic.easeOut}) ); myTimeline1.insert( new TweenMax(tree, 2, {y:200, ease:Bounce.easeOut}) ); function greenoverHandler(event:MouseEvent):void { myTimeline.play(); } function greenoutHandler(e:MouseEvent):void { myTimeline.reverse(); } //RED BUTTON function clickButtonHandler(e:MouseEvent):void { import flash.external.ExternalInterface; ExternalInterface.call("animatedcollapse.show('redbutton')"); ExternalInterface.call("animatedcollapse.hide('mainContent')"); //trace ("toggleDiv"); } //YELLOW BUTTON function yellowclickHandler(event:MouseEvent):void { myTimeline1.yoyo(); } When I try the myTimeline1.yoyo(); it says "inaccessible method" and myTimeline1.play(); obv just plays the animation once. or forever on repeat.
  3. UPDATE: Hey thanks alot for your advice. which as you already know was right The problem with the buttons not working was obviously not tweenmax so I had to go back and look at my html, I was using a jQuery code to make the div's draggable and that was messing things up. (What a suprise?!) I found this post that kinda explained the problem. http://old.nabble.com/Embedded-Flash-Draggable-on-Safari-td19394706s27240.html? and the here is a 2mb fla of what im talking about. http://www.inmomentmedia.com/files/PV3D.fla.zip //code import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; import flash.events.MouseEvent; import flash.external.ExternalInterface; red_btn.addEventListener(MouseEvent.CLICK, clickButtonHandler); yellow_btn.addEventListener(MouseEvent.CLICK, yellowclickHandler); grass.addEventListener(MouseEvent.ROLL_OVER, greenoverHandler); grass.addEventListener(MouseEvent.ROLL_OUT, greenoutHandler); var myTimeline:TimelineMax = new TimelineMax({repeat:-1, yoyo:true, overwrite:false, paused:true}); myTimeline.insert( new TweenMax(asciitowel, 3, {y:-500, ease:Sine.easeInOut}) ); var myTimeline1:TimelineMax = new TimelineMax({paused:true}); myTimeline1.insert( new TweenMax(paper, 1, {y:200, ease:Quad.easeOut}) ); myTimeline1.insert( new TweenMax(rainbow, 3, {y:250, ease:Elastic.easeOut}) ); myTimeline1.insert( new TweenMax(tree, 2, {y:200, ease:Bounce.easeOut}) ); function greenoverHandler(event:MouseEvent):void { myTimeline.play(); } function greenoutHandler(e:MouseEvent):void { myTimeline.reverse(); } function clickButtonHandler(e:MouseEvent):void { import flash.external.ExternalInterface; ExternalInterface.call("animatedcollapse.toggle('mainContent')"); //trace ("toggleDiv"); } function yellowclickHandler(event:MouseEvent):void { myTimeline1.play(); //myTimeline1.toggle(); }
×
×
  • Create New...