Jump to content
GreenSock

Vince

Members
  • Posts

    9
  • Joined

  • Last visited

Vince's Achievements

0

Reputation

  1. Apologies Carl, I hadn't noticed I had posted in the JS section, this is, as you rightly point out is AS3, which is what I'm building in. I copied and pasted an example which must have been from the JS docs. Can you move the thread? Thank you.
  2. Thanks for the top tips. However I do seem to be having an issue with the following. This works fine: myTimeline.add(TweenMax.to(lampMatrix.Lamp24_mc.LampSquare_mc, fadeLength, {colorMatrixFilter:{colorize:0xfffe72, amount:1}})); myTimeline.add(TweenMax.to(lampMatrix.Lamp19_mc.LampSquare_mc, fadeLength, {colorMatrixFilter:{colorize:0xfffe72, amount:1}})); This doesn't seem to apply the filter or show any errors: myTimeline.to(lampMatrix.Lamp24_mc.LampSquare_mc, fadeLength, {colorMatrixFilter:{colorize:0xfffe72, amount:1}}) .to(lampMatrix.Lamp19_mc.LampSquare_mc, fadeLength, {colorMatrixFilter:{colorize:0xfffe72, amount:1}}); What am I doing wrong? PS. I can see your example playing in codepen, but unfortunately no code or comments are visible. Again am I missing something simple there? Thanks Vince
  3. Hi there, Quick question, previously I have been using the add() method in timelinemax to add tweens to the timeline and align their start times: myTimeline.add([TweenMax.to(element1, 1, {left:100, opacity:0.5}), TweenMax.to(element2, 1, {right:50, opacity:1})]); Is it possible to do the same thing just using the to() method? As I'm trying to make my code as lean as possible, along with using the correct methods. In other words have the following tweens all start at the same time: myTimeline.to(element1, 1, {left:100, opacity:0.5}) .to(element2, 1, {right:50, opacity:1}); Thanks guys
  4. Hi guys, Just getting upto speed with the new syntax methods of v12 (I know its not so new now!) Does the to() method example in the timelinelite docs have a typo or am I misunderstanding the example? Line 7, opacity 0 // comment says 0.5 //create a timeline that calls myFunction() when it completes var tl = new TimelineLite({onComplete:myFunction}); //now we'll use chaining, but break each step onto a different line for readability... tl.to(element, 1, {left:100}) //tween element's "left" property to 100 .to(element, 1, {top:50}, "-=0.25") //then tween element's "top" property to 50, starting 0.25 seconds before the previous one ends .set(element, {opacity:0}) //then set element's opacity to 0.5 immediately .call(otherFunction) //then call otherFunction() .staggerTo([e1, e2, e3], 1.5, {rotation:45}, 0.25); //finally tween the rotation of e1, e2, and e3 to 45 and stagger the start times by 0.25 seconds
  5. Thanks for the great responses, you maybe right about the structure or architectural setup. Currently using version 11, but only because I have a very long animation I don't want to have to go through and update with new code yet. I did come up with a solution by applying my function in the tween length value instead of using a variable: myTimeline.append(TweenMax.to(mc, calcSpeedx(location01_x, location02_x), {x:location02_x, delay:animDelay, ease:animEase})); myTimeline.append(TweenMax.to(mc, calcSpeedx(location02_x, location03_x), {x:location03_x, delay:animDelay, ease:animEase})); function calcSpeedx(startLocation_x, endLocation_x:Number):Number { return Math.abs((endLocation_x - startLocation_x) / speed_x); } This works fine, however I notice it does go through all the appended tweens simultaneously when creating the timeline, which I assume logically is correct. I was ideally hoping it would calculate the length of the tween, play it and move onto the next tween in sequence. As I'm fairly new to this, I'm not sure if its the right way or ideal way of doing this. Thanks again for your suggestions, I'll look at those next and see if they are a better solution.
  6. Hello again My current issue is probably quite a simple one, however after various research on here I have not yet found the solution. Any help would be greatly appreciated. I calculate the speed of a tween based on a start and end location of an object when tweening, however the variable which holds the value of this speed calculation doesn't update the tween before it runs. myTimeline.append(TweenMax.to(mc, speed_x, {onInit:calcSpeedx, onInitParams:[location01_x, location02_x], x:location02_x, delay:animDelay, ease:animEase})); function calcSpeedx(startLocation_x:Number, endLocation_x:Number):void { speed_x = Math.abs((endLocation_x - startLocation_x) / pixelsPerSecond_x); } Is there a simple way of using a variable for the speed of a tween, calculated from within that same tween? Many thanks for your help Vince
  7. Carl Perfect, onStart passing the params works a treat! I had completely overlooked this. Thank you!
  8. Hi Carl, Thanks for the welcome and quick response. Will give this a go and report back!
  9. Hi All, I am looking for some advice and guidance please. I currently have a Timeline with various tweens appended within this timeline (Sequence). I then have a dynamic text box which I want the content to update with text I have populated in an array. I am currently using onUpdate to update my text boxes, however only the last update is ever shown at run time in my text box, as I assume its already jumped through all the previous tweens at the same time, even though I have various other tweens appended before and after. I assume I am not using the onUpdate function correctly? How can I get my text boxes to update one after the other (sequence) like previous tweens I have appended to the timeline. Example part of my code: function setSteptext(stepNumbercount:int):void { stepNumber.stepNumberfield.text = String(stepNumbercount); stepText.stepTextfield.text = descripArray[stepNumbercount]; trace(stepNumber.stepNumberfield.text); } var myTimeline:TimelineMax = new TimelineMax(); myTimeline.append(TweenMax.to(this, fadeSpeed, {onUpdate:setSteptext(1)})); myTimeline.append(TweenMax.to(this, fadeSpeed, {onUpdate:setSteptext(2)})); myTimeline.append(TweenMax.to(this, fadeSpeed, {onUpdate:setSteptext(3)})); myTimeline.append(TweenMax.to(this, fadeSpeed, {onUpdate:setSteptext(4)})); There are other Tweens appended inbetween these text updates (have removed them for simplicity), these play one after the other fine, as I'd expect however the text tweens which use onUpdate seem to run straight through without waiting for any other tweens. Thanks in advance Vince
×