Jump to content
Search Community

robertnyc

Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by robertnyc

  1. I'm trying to figure out how to something like this: http://www.hakim.se/experiments/html5/wave/03/ It's math I know (which math?) -- but bezierThrough seemed so tantalizingly close -- tried with curveTo from the flash lib, and it works great for one curve, but all the rest......no
  2. Has anyone used TweenMax to generate semi-realistic waves? It seems like something interesting could be done with the bezier plugins (although perhaps AS3's curveTo would suffice), and the physics plugin. If no, any pointers to good code that shows how it might be done?
  3. Thanks. It's probably that I'm fading the images in -- and sometimes moving them -- that's bogging it down.
  4. I just did a project using TweenMax and some large imported images. The image manipulation was slow -- which is due to the inherent nature of the beast, nothing to to with TweenMax, I know. What are your tips for tweening large images? • Alpha: if you're fading in and out Stage-sized images, what works best: tweening the alpha of the image, tweening the alpha of a mask, or...? • Movement: how to move things swiftly? Is it best to work with bitmaps, movieclips, does it make one iota of difference? I've seen some interesting code (that Jack pointed to in another post) dealing with quick ways to move a large image across screen (using CopyPixels) -- but this seems something different here. I'd be curious to hear of any creative solutions -- even extending to using Alchemy or whatever :->
  5. Yes, of course. Thanks -- it was simply that the tween in the plugin explorer was set long enough (4 seconds) that I stopped exploring before it ran out -- assumed it ran forever, but if I moved mouse long enough, sure enough tween stopped.
  6. Thanks -- I'm somewhat sleep deprived today as well so perhaps I was unclear. I think it must be something like what you did in the internals of CirclePath2DPlugin -- simply that as you move around a circle the angle will jump from 360 to 0, for instance, so if you're tweening from 180 to 70 you're going to have a tween from 180 to 360 then from 0 to 70; timeline sounds like a good plan.
  7. If you use dynamic properties plugin in the tween, is the tween always 'running'. That is, in the example you have on the site, the tween will always follow the mouse. Thus the tween is now a function that's always "listening'? Does this mean that any tweened objects are then never garbage-collected?
  8. What's the best way to do a discontinuous tween? This arises in a project I'm working on where I need to rotate an object around a circle -- and also rotate the object to always face the center. Due to the geometry there was a case where the range was discontinuous and I got a situation like this _nuRotation = _angleInDegrees < 0 || (_angleInDegrees >0 && _angleInDegrees <=90)? _angleInDegrees +90 : _angleInDegrees -270; Don't worry about what it means -- the point is that there was a break, as there must be, in the circular degrees. Now in this incarnation I'm moving the mouse and rotating everything based on that. What I'd like to do is programmatically move things -- and use TweenMax to tween the angle and then set everything based on that. (Note I can't simply use rotation, as it's an object rotating around something, etc etc). How would I do this? I could use onUpdate during the tween to check and "jump" the tweening values, but if I'm one tween update behind or ahead, I could have the object flying to the opposite side of the circle, then back. Is there anyway in TweenMax to specify something like tween from a to b then from c to d in one tween. I suppose you could set up two tweens, but looking for simplicity?
  9. Thanks. I misread the following post -- I thought it was you posting the first post, not the other fellow, that's where I got the idea from -- http://forums.greensock.com/viewtopic.php?f=1&t=3129
  10. I'm doing a rush project that involves importing some large AI files into flash and moving things around -- As you might suspect, these AI files lead to a gazillion little pieces in the movie clips. Therefore, when I'm zoomin' and twistin' and scalin' the MC the performance is not as fast as I'd like. The obvious answer would be to make a bitmap of the entire movieclip. But not wanting to rewrite chunks o' code I thought I'd ask: is there any simpler way to speed things up when working with complex MCs? I thought I'd hit it with cacheAsBitmap but I read that a) TweenMax/Lite turns this off when tweening, and this can actually slow things down. Any answers much appreciated
  11. How do you make Timelines dependent on dynamic variables? That is, let's say you set up a timeline such as _myTimeline.insert(new TweenMax(myObj,1,{x:someIntegerVariable})); and let's say, for instance, that you set someIntegerVariable based on a mouseDown -- so that you want myObj to tween to where the mouse click is (this is all pseudo code/bogus example, but just for illustration). For me, the timeline doesn't "know"to update when the underlying variables change. That is, it will always tweeen to whatever someIntegerVariable was when the timeline was set up originally. _myTimeline.invalidate() doesn't seem to help -- Or am I doing something wrong?
  12. I was poring through the LiquidStage source and came upon the configuration import com.greensock.layout.~~; I've never seen an import statement written that way (usually import com.greensock.layout.*) and googling didn't reveal anything. Why is it written that way? Robert
  13. Is there any circumstance in which this _arrowTimeline = new TimelineMax({onComplete:enableArrow,paused:true}); _arrowTimeline.insert(new TweenMax(purplearrow,TWEENTIME,{y:purplearrow.origY,ease:EASE})); _arrowTimeline.append(new TweenMax(purplearrow,TWEENTIME,{alpha:ARROW_PULSE_MAX,ease:EASE,yoyo:true,repeat:-1})); will fail to call the onComplete function? It fails every time. If I change it to call onComplete in one of the tweens it works. Why? I'm sure I'm missing something simple _arrowTimeline = new TimelineMax({paused:true}); _arrowTimeline.insert(new TweenMax(purplearrow,TWEENTIME,{y:purplearrow.origY,ease:EASE,onComplete:enableArrow})); _arrowTimeline.append(new TweenMax(purplearrow,TWEENTIME,{alpha:ARROW_PULSE_MAX,ease:EASE,yoyo:true,repeat:-1}));
  14. OK, that seems to work, but it seems I would then have to set up all tweens twice (not a big deal, but when there are a lot of tweens....) Does TweenMax store a copy of the ease function, or simply a reference? I thought that the following might be the simplest solution (in pseduo code) var _ease:Function = Quad.easeOut; myTweenMax = new TweenMax(something,someTime,{someparams,ease:_ease}); myTimeline = new TimelineMax(); myTimeline.insert(myTweenMax); function changedirection():void { if timeline is playing forward { _ease = Quad.easeIn; timeline.reverse(); } else { _ease = Quad.easeOut; timeline.play(); } } but that doesn't seem to work
  15. If you have multiple tweens with eases in a timeline, is there an easy way to keep the same ease on reverse? That is, if you have the ease on the original tweens as easeOut, when you reverse() the timeline they become easeIn (as far as I can see), which makes sense. But is there an easy way to make them remain easeOut? I see no overall ease on the timeline itself, although I suppose you could tween the currentProgress of the timeline and then adjust that ease. But that ruins the elegance of the simple timeline play()/reverse() (really nifty stuff!). One could also change the ease on the tweens, but again, that seems kludgy. Am I missing an easier method?
  16. I also discovered that if I did gotoAndStop(-DELAY) it works too
  17. If you do _timeline = new TimelineLite({paused:true,,delay:DELAY}) _timeline.insertMultiple(tweens,0,TweenAlign.START,STAGGER); _timeline.play(); and then later do _timeline.gotoAndStop(0); and then still later do _timeline.play() is the original delay respected? It seems that it's not -- that timeline starts without delay
  18. Two quick questions: 1) Let's say I have a sequence of tweens that I want to insertMultiple into a TimelineLite/Max (tll/m). I want the start of the tweens to stagger, so let's say tween 1, staggertime, tween 2, staggertime, tween3, staggertime, tween4. But let's say I want tweens 2 and 3 to start at the same time. Everything else the same. What's the most efficient way to accomplish this? That is -- to have one tween in a staggered sequence not push the rest of the tweens forward, to have _it's_ staggertime ignored? I could add it at the end of the tll/m and then muck about with a negative delay, or leave it out of the insertMultiple and then insert it at a certain time in the tll/m, but is there a better way? 2) I know this is simple -- but when you set align in tll/m constructor's special properties, the docs say that if you change the time of one tween the others aren't respected (or something to that effect). As I read the docs, when you have a sequence of tweens, under some conditions changes in the lengths of one tween will push the others back/forward, under other circumstances this won't happen. I cop to being unclear on this (I have rewatched the helpful video) -- what's the rubric? BONUS QUESTION: how do you get the current start time of a Tween in a tll/m sequence? That is, if I insert multiple a bunch of tweens, and then later want to get the start time of tween 2, for example, to add a label there, etc. Of course I can keep track of the time in another variable, but is there a way to query the tll/m for this info? Thanks for great work!
  19. Let's say I want to tween a number of objects, stagger them, and tween them to a specific variable which I've stored within the object. That last means simply that if I'm tweening a MovieClip to a particular y, I've stored that y in a variable on the MovieClip (i.e. myMovie.specialY = 1234). What's the best way to do this? The main issue I'm having is accessing that stored variable in an efficient way. How would I do this in TweenMax.allTo? I was looking at TimelineLite/Max -- it looked like a nice scheme. Same question, what's the best way to set something like this up? I think if there were an easy way within the GS function calls to access the object being tweened that might do it -- I'm sure there's a really obvious point I'm missing, but when I simply to something like TweenMax(mc,1, {mc.myProperty}), it says it doesn't understand "myProperty". Do I need to make mc a custom class and include import the class file? My solution in the end was to do something like this: // _allBars:Array; previously set up array of movieclips // t, INC, SPEED: Number; previously set up rate determiners -- t determines stagger for (var i:int = 0; i < _allBars.length; i++) { t = i * INC; var mc:MovieClip = _allBars[i] as MovieClip; TweenMax.to(mc, SPEED, {delay:t, y:mc.initY } ); } Extra bonus question: is there a way to use Timeline to tween a set of multiple TweenMax.allTo's? I have the basic thought to construct Timeline instances using insertMultiple and the results of calls to TweenMax.allTo() -- and then insert those timelines into another Timeline using insertMultiple again, but my head spins -- and I still can't figure out a way to access custom properties on my tweened objects.
  20. I've got one MovieClip serving as a dragger -- when I click on it I assign an onEnterFrame event listener (AS3) that each time through TweenMax's it to next position - to the new MouseX more precisely. I want Movielips INSIDE this MovieClip to spin around their centers, so I also set going a TweenMax for rotation (or I use rotate around center from the GS plugins) -- the problem is this internal rotation stops almost immediately. The effect I want is a spinning ball I drag around (more or less). It seems to be due to overwriting. If I set overwriting to NONE it all works ok. But then the dragging is jerky -- as the successive drag tweens (to new MouseX) are not immediately overwriting themselves, I presume. But if I set overwrite to AUTO, it fails, as per above. What to do? I'm using latest and greatest GS libs. Thanks Robert
×
×
  • Create New...