Jump to content
Search Community

jdb

Members
  • Posts

    10
  • Joined

  • Last visited

jdb's Achievements

0

Reputation

  1. I understand I can do this to reset mc1's y destination value every time my timeline restarts: var myTween:TweenMax = TweenMax.to(mc1, 1, {y: mySetDestinationFunction()}); timeline.append(myTween); ... timeline.stop(); timeline.totalProgress = 0; myTween.updateTo({y: mySetDestinationFunction()}, true); timeline.gotoAndPlay[0]; What I can't figure out is how to take this: TweenMax.allTo([mc1, mc2], 1, {y: mySetDestinationFunction()}) and get it into a named tween so I can use a single updateTo to reset multiple MovieClip's y destination values. As if I could do this: var myTweens:TweenMax = TweenMax.allTo([mc1, mc2], 1, {y: mySetDestinationFunction()}); timeline.append(myTweens); // or maybe timeline.appendMultiple(myTweens) myTweens.updateTo({y: mySetDestinationFunction()}, true);
  2. Thank you sir. I do appreciate deadlines. They make the world go around. Best of luck with your project. Jeffrey Bowman
  3. Good morning Jack! I'm already a proud member of Club Greensock! I've uploaded the current state of my SWF to our business's testing web site here: http://www.make-shades.com/test6.php We're in the business of selling the instructions and goods necessary for people to make their own roman shades. I'm trying to create a roman shade "design" application letting potential customers set the shade's width, length and folds and then accurately animate the shade's geometry and raising and lowering action. One key consideration is what our industry calls shade "stackage". Stackage is the resulting length of a shade when it's in its fully raised position. For any given shade length and number of folds I can accurately determine the shade's stackage and I want to visually represent that value when my application's shade is in the fully raised position.. To understand my initialization requirement please visit my app and, using the default shade, do the following: 1) Click anywhere within the grid or within the shade to start my raising timeline. Subsequent clicks will toggle the timelines forward and backward. - Notice my default shade is 50 inches long and when fully raised its bottom ends up near 11 1/2 inches on the grid. A 50 inch shade made with 4 folds (represented by 5 shade sections) has a predictable stackage of 11 1/2 inches. 2) Using the "Shade Length" stepper (located near the app's upper, right corner) lengthen the shade to exactly 60 inches and then raise it. - You'll see when fully raised its bottom ends up just shy of 22 inches on the grid. I need it to end up at 12 1/2 inches. Here's my timeline code for raising those five sections. The dynamic y values are what need to be reinitialized whenever the shade length changes: frontTimeline.append(TweenMax.to(frontSection5, myTweenTime/2, {y: bottomSectionRaiseValue(), ease:Linear.easeNone})); frontTimeline.appendMultiple([TweenMax.to(frontSection5, myTweenTime, {y:frontSectionRaiseValue(4), ease:Linear.easeNone}), TweenMax.to(frontSection4, myTweenTime, {y:frontSectionRaiseValue(4), ease:Linear.easeNone}) ]); frontTimeline.appendMultiple([TweenMax.to(frontSection5, myTweenTime, {y:frontSectionRaiseValue(3), ease:Linear.easeNone}), TweenMax.to(frontSection4, myTweenTime, {y:frontSectionRaiseValue(3), ease:Linear.easeNone}), TweenMax.to(frontSection3, myTweenTime, {y:frontSectionRaiseValue(3), ease:Linear.easeNone}) ]); frontTimeline.appendMultiple([TweenMax.to(frontSection5, myTweenTime, {y:frontSectionRaiseValue(2), ease:Linear.easeNone}), TweenMax.to(frontSection4, myTweenTime, {y:frontSectionRaiseValue(2), ease:Linear.easeNone}), TweenMax.to(frontSection3, myTweenTime, {y:frontSectionRaiseValue(2), ease:Linear.easeNone}), TweenMax.to(frontSection2, myTweenTime, {y:frontSectionRaiseValue(2), ease:Linear.easeNone}) ]); frontTimeline.appendMultiple([TweenMax.to(frontSection5, myTweenTime/2, {y: topSectionRaiseValue(), ease:Linear.easeNone}), TweenMax.to(frontSection4, myTweenTime/2, {y: topSectionRaiseValue(), ease:Linear.easeNone}), TweenMax.to(frontSection3, myTweenTime/2, {y: topSectionRaiseValue(), ease:Linear.easeNone}), TweenMax.to(frontSection2, myTweenTime/2, {y: topSectionRaiseValue(), ease:Linear.easeNone}), TweenMax.to(frontSection1, myTweenTime/2, {y: topSectionRaiseValue(), ease:Linear.easeNone}) ]); Here's my timeline initialization code: var timeline:TimelineMax = new TimelineMax(); // frontTimeline and backTimeline are timelineLite instances for the front and back shade views var frontTimeline:TimelineLite = new TimelineLite(); var backTimeline:TimelineLite = new TimelineLite(); timeline.appendMultiple([frontTimeline, backTimeline]); Here's my shade length stepper change function: function stepWindowLength(event:Event):void { theWindowLength = stepperWindowLength.value; theShadeLength = stepperWindowLength.value; stepperCoverUpWindowLength.text = stepperCoverUpString(theWindowLength); // call changeShade function changeShade(); } Here's the salient timeline code within my changeShade() function: timeline.stop(); timeline.totalProgress = 0; // snap the shade to its fully lowered position timelineStarted = false; By the end of the changeShade() function the shade sections have been resized and the shade has been snapped down to its fully lowered position ready to be raised upon the next click. Finally, here's the salient code that raises and lowers the shade by managing my main timeline. I think it's here I need to do my invalidation but I don't know how: buttonRaiseLower.addEventListener(MouseEvent.CLICK, manageTimeline); function manageTimeline(event:MouseEvent):void { if (!timelineStarted) { frontTimeline.invalidate(); <==== this isn't causing re-initialization of my dynamic y-values timeline.gotoAndPlay(0); timelineStarted = true; timelineReversed = false; } You can see I've tried frontTimeline.invalidate(); but it doesn't work. Is creating individual tweenMax instances, adding them to my frontTimeline and then invalidating them the correct tool for my requirement? If not, what would you suggest?
  4. Thanks Jack! With advancing age the generator isn't putting out as much power but it's still capable of turning on the lightbulbs so please bear with me. Continuing with his example, suppose I'm currently doing this: myTimeline.appendMultiple([TweenMax.to(mcBall1, 1, {y: sliderPosition(1)}), TweenMax.to(mcBall2, 1, {y: sliderPosition(2)}), TweenMax.to(mcBall3, 1, {y: sliderPosition(3)}), TweenMax.to(mcBall4, 1, {y: sliderPosition(4)}), TweenMax.to(mcBall5, 1, {y: sliderPosition(5)})) ]); followed immediately with this: myTimeline.appendMultiple([TweenMax.to(mcBall1, 1, {y: newPosition(1)}), TweenMax.to(mcBall2, 1, {y: newPosition(2)}), TweenMax.to(mcBall3, 1, {y: newPosition(3)}), TweenMax.to(mcBall4, 1, {y: newrPosition(4)}), TweenMax.to(mcBall5, 1, {y: newPosition(5)})) ]); Do I have to create 10 separate var myTweenX:TweenMax= new TweenMax(mcBallX... instances to re-initialize the values returned by the two functions or is there a way of attacking the re-initialization requirement using myTimeline? I apologize for my ignorance as I grapple with OO concepts but, having read the docs and seeing invalidation also invalidates the children, are the tweens added to a timeline considered "children" of the timeline and they too will be invalidated if the timeline is invalidated? Thank you for your support of this noob.
  5. Ahhhh. Ok. Thank you. Yes, I was trying to directly invalidate() a MovieClip. I've been using the same technique as he when placing tweens in my timeline. He used: myTimeline.append( TweenMax.to(mcBall, 1, {y: sliderPosition}) ) but if I now do what you describe: var myTween:TweenMax= new TweenMax(mcBall, 1, {y:sliderPosition}); would I then add it to my timeline by using ? myTimeline.append(myTween);
  6. Good afternoon Greensock! I'm at exactly the same point this previous poster was at and I understand your answer and the need to invalidate() the tween so it re-initializes the next time run. What I'm struggling with is the code necessary to do it. Using his example, when I try to do: mcBall.invalidate(); I'm getting the following error: TypeError: Error #1006: invalidate is not a function. So I'm missing something somewhere. Can you point me in the right direction please?
  7. Thank you kind sir! It looks like after breakfast I'm going to have to peel another layer off the Actionscript onion to learn about this this. My best to you and yours! Jeffrey
  8. Hello, I'm a noob at this from so many perspectives. I hope asking this basic an Actionscript question isn't an inappropriate use of this forum. If it is please let me know. I'm trying to build a Flash application for my business. My customers can build a widget I sell. The widget can be "designed" by telling us how many rectangular sections they want, the length and width of the sections and their color. The most sections a widget can contain is 11. Using Flash CS4's IDE I've created (and positioned offstage) 11 rectangular MovieClips giving them the instance names of: section1 section2 ... section11 These "sections" will always be used in numeric order. For instance a 5-section widget would use section1, section2, section3, section4 and section5. I understand and have been successful using the power of TweenLite/Max doing this for instance: var theNumberOfSections:Number = 5; var theSections:Array = new Array; theSections = [section1,section2,section3,section4,section5]; TweenMax.allTo(theSections, 0, {colorTransform:{tint:0xFF0000, tintAmount:0.3}}); or: for(i=0; i < theNumberOfSections-1; i++) { TweenMax.to(theSections, 0, {colorTransform:{tint:0xFF0000, tintAmount:0.3}}); } What I'm struggling with is how to dynamically populate my "theSections" array with my MovieClips based upon the dynamic value supplied via "theNumberOfSections". I guess I could brute force the issue by: ... else if (theNumberOfSections == 4) { theSections = [section1,section2,section3,section4]; } else if (theNumberOfSections == 5) { theSections = [section1,section2,section3,section4,section5]; } ... but how can I do it using "for" looping? When I try this: for(i=0; i < theNumberOfSections-1; i++) { theSections = "section" + (i+1); } my TweenMax is failing with "Property colorTransform not found on String and there is no default value" as if I handbuild the array as ["section1","section2","section3","section4","section5"]. How can I get MovieClips in there and not string values? Thanks in advance, Jeffrey
  9. I think I'm mostly there Jack! Some of the nuances slip by me though. For instance if you change my value of targetHeight from 0 (which fails) to 0.49 it still fails (but in a different way). From my code example, the comments describe the outcomes: // Some target heights for testing //var targetHeight = 1.00; // works well //var targetHeight = 0.50; // works well //var targetHeight = 0.49; // transformAroundPoint tween heading back to full height is mis-starting just north of 160,280 var targetHeight = 0.00; // transformAroundPoint tween heading back to full height starts correctly but only makes it half way back to full height I'll just take the height down to 1px to keep things manageable and predictable. Thanks much for your assistance and fine product! My best to you and yours, Jeffrey
  10. Good evening, I'm trying to tween a rectangular mask down to zero height and back again using transformAroundPoint and having some unexpected results. I'm very new to this so, just to be sure and perhaps isolate it to transformAroundPoint, I'm also doing a "normal" height tween on a second, simple (non-mask) rectangle which work flawlessly. The shrinkage goes normally. It's upon the growth back to full size that the transformAroundPoint trouble sets in. All works well as long as my target shrunken height is 0.50 or more. Below that, to zero, results vary. Am I doing something wrong choosing my new Point(x,y) coordinates that's throwing it off? Any insights would be much appreciated. I've attached my FLA file but here's my testing code just in case: import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; TweenPlugin.activate([TransformAroundPointPlugin]); function onFinishTween(param1:MovieClip):void { trace('X is ' + param1.x); trace('Y is ' + param1.y); trace('Width is ' + param1.width); trace('Height is ' + param1.height); } var tweenTime1 = 1; // Some target heights for testing //var targetHeight = 1.00; // works well //var targetHeight = 0.50; // works well //var targetHeight = 0.49; // transformAroundPoint tween heading back to full height is mis-starting just north of 160,280 var targetHeight = 0.00; // transformAroundPoint tween heading back to full height starts correctly but only makes it half way back to full height var timeline:TimelineLite = new TimelineLite(); timeline.append(TweenMax.to(mcRectangleRed, 0, {alpha: 0})); timeline.appendMultiple([TweenMax.to(mcMask, tweenTime1, {transformAroundPoint:{point:new Point(160, 280), height: targetHeight}, onComplete: onFinishTween, onCompleteParams:[mcMask]}), TweenMax.to(mcRectangle, tweenTime1, {alpha: 0, ease:Linear.easeNone}), TweenMax.to(mcBaseline, tweenTime1, {height: targetHeight, ease:Linear.easeNone})]); timeline.appendMultiple([TweenMax.to(mcMask, tweenTime1, {transformAroundPoint:{point:new Point(160, 280), height: 280}, onComplete: onFinishTween, onCompleteParams:[mcMask]}), TweenMax.to(mcRectangleRed, tweenTime1, {alpha: 1, ease:Linear.easeNone}), TweenMax.to(mcBaseline, tweenTime1, {height: 280, ease:Linear.easeNone})]); Thanks in advance, Jeffrey
×
×
  • Create New...