Jump to content
Search Community

Haansplosion

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Haansplosion

  1. Hi Jack, Sorry if this is a stupid question, but i have today started trying to develop for iOS using AS3 and Flash, and was wondering will tweenlite, tweenmax or any other greensock solution work in iOS apps? In the first test i did none of my tweens worked, and I couldnt find any documentation on it. Thanks in advance!
  2. You guys are absolute heroes! Id never even heard of Dictionary before, thanks for introducing me it seems very handy! Absolutely changes the way i think about things. Now i have clean, efficient and working code! Thanks so much Greensock. You are amazing.
  3. Hi Guys and the ever amazing Captain GreenSock, I have read through this thread and completely understand why you've set timelines to be paused independantly when they are nested. But therein lies my problem! Im trying to make a system where the user is presented with a series of checkboxes at the start that allow them to switch on/off the parts of the timeline, and it will then dynamically create a timeline, playing only what they selected. So for example if the user wants to see Items 1, 3 and 7; a mainTimeline is created that nests and plays timeline1-timeline3-timeline7, and so on and so forth for any other custom combinations they might need. The reason im wanting to do this is because i need to include the ability to scrub through the entire presentation using tweenTo, but need it to scrub through only what they chose to see, and the others to remain hidden. So for example if they are watching 1, 3 and 7 and choose to scrub back to the start, it only goes back through 7, 3 and then to 1. (1,2,4,5,6 are hidden) At the moment thats not working the way im doing it, and i understand why. I dont want the individual timelines to play until its their turn, so i have to set them to {paused:true}. And when i play the mainTimeline they remain paused. Makes perfect sense but i cant think of a workaround that would allow me to play them in order. In my sample file, im passing which timelines need to be loaded into an array, then checking the array in a gateway once they press the play button, nesting the chosen ones inside the main timeline. Im sure there is an easier way to do this, but cant seem to get it. Im hoping that makes sense! Im a little new to AS3, so my coding probably completely sucks, but if you could please take a look and tell me where im going wrong i would be forever grateful! Feel free to completely tear apart any of my coding, id love some constructive criticism. [attachment=0]DynamicTimeline.zip[/attachment] package { import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; import flash.events.*; import com.greensock.*; import com.greensock.easing.*; public class Main extends MovieClip { var timelineArray:Array = new Array(3); var mainTimeline:TimelineMax = new TimelineMax({}); var timeline1:TimelineMax = new TimelineMax({paused:true}); var timeline2:TimelineMax = new TimelineMax({paused:true}); var timeline3:TimelineMax = new TimelineMax({paused:true}); public function Main() { this.init(); } private function init(){ setupTimelines(); trace("Lets do arrays") addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler); } function setupTimelines(){ timeline1.append(TweenLite.to(button1, 1, {rotation:"20"}) ); timeline2.append(TweenLite.to(button2, 1, {rotation:"-20"}) ); timeline3.append(TweenLite.to(button3, 1, {rotation:"52"}) ); } function onMouseDownHandler(event:MouseEvent){ if (event.target == button1){ timelineArray[0] = "1enabled"; } if (event.target == button2){ timelineArray[1] = "2enabled"; } if (event.target == button3){ timelineArray[2] = "3enabled"; } if (event.target == playtimelineButton){ timelineGateway(); } trace(timelineArray) } function timelineGateway(){ if(timelineArray[0] == "1enabled"){ mainTimeline.append(timeline1); } if(timelineArray[1] == "2enabled"){ mainTimeline.append(timeline2); } if(timelineArray[2] == "3enabled"){ mainTimeline.append(timeline3); } mainTimeline.play() } } }
  4. Hi Guys and the ever amazing Captain GreenSock, I have read through this thread and completely understand why you've set timelines to be paused independantly when they are nested. But therein lies my problem! Im trying to make a system where the user is presented with a series of checkboxes at the start that allow them to switch on/off the parts of the timeline, and it will then dynamically create a timeline, playing only what they selected. So for example if the user wants to see Items 1, 3 and 7; a mainTimeline is created that nests and plays timeline1-timeline3-timeline7, and so on and so forth for any other custom combinations they might need. The reason im wanting to do this is because i need to include the ability to scrub through the entire presentation using tweenTo, but need it to scrub through only what they chose to see, and the others to remain hidden. So for example if they are watching 1, 3 and 7 and choose to scrub back to the start, it only goes back through 7, 3 and then to 1. (1,2,4,5,6 are hidden) At the moment thats not working the way im doing it, and i understand why. I dont want the individual timelines to play until its their turn, so i have to set them to {paused:true}. And when i play the mainTimeline they remain paused. Makes perfect sense but i cant think of a workaround that would allow me to play them in order. In my sample file, im passing which timelines need to be loaded into an array, then checking the array in a gateway once they press the play button, nesting the chosen ones inside the main timeline. Im sure there is an easier way to do this, but cant seem to get it. Im hoping that makes sense! Im a little new to AS3, so my coding probably completely sucks, but if you could please take a look and tell me where im going wrong i would be forever grateful! Feel free to completely tear apart any of my coding, id love some constructive criticism. DynamicTimeline.zip package { import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; import flash.events.*; import com.greensock.*; import com.greensock.easing.*; public class Main extends MovieClip { var timelineArray:Array = new Array(3); var mainTimeline:TimelineMax = new TimelineMax({}); var timeline1:TimelineMax = new TimelineMax({paused:true}); var timeline2:TimelineMax = new TimelineMax({paused:true}); var timeline3:TimelineMax = new TimelineMax({paused:true}); public function Main() { this.init(); } private function init(){ setupTimelines(); trace("Lets do arrays") addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler); } function setupTimelines(){ timeline1.append(TweenLite.to(button1, 1, {rotation:"20"}) ); timeline2.append(TweenLite.to(button2, 1, {rotation:"-20"}) ); timeline3.append(TweenLite.to(button3, 1, {rotation:"52"}) ); } function onMouseDownHandler(event:MouseEvent){ if (event.target == button1){ timelineArray[0] = "1enabled"; } if (event.target == button2){ timelineArray[1] = "2enabled"; } if (event.target == button3){ timelineArray[2] = "3enabled"; } if (event.target == playtimelineButton){ timelineGateway(); } trace(timelineArray) } function timelineGateway(){ if(timelineArray[0] == "1enabled"){ mainTimeline.append(timeline1); } if(timelineArray[1] == "2enabled"){ mainTimeline.append(timeline2); } if(timelineArray[2] == "3enabled"){ mainTimeline.append(timeline3); } mainTimeline.play() } } }
×
×
  • Create New...