Jump to content
Search Community

ollywood

Members
  • Posts

    5
  • Joined

  • Last visited

ollywood's Achievements

0

Reputation

  1. Thanks Thorjelly - that definitely does the job (it was a route I was looking to go down if the pure TweenMax solution wasn't forthcoming, altho you've made a more elegant job of it than I probably would have!), cheers. Shame there's not a more straightforward way of doing it. Olly (PS - just in case anyone else makes use of the code, the line var blueOffset:int = Math.min(blueOffset * (7 / 3), 255); should be var blueOffset:int = Math.min(redOffset * (7 / 3), 255); using the redOffset as the benchmark for the calculation. ...Thanks again!)
  2. Hi all, I'm trying to tween various values of the colour transform over separate tween lengths, as per code below: TweenMax.to(testIMG, 3, {colorTransform:{blueOffset:255}}); TweenMax.to(testIMG, 5, {colorTransform:{greenOffset:255}}); TweenMax.to(testIMG, 7, {colorTransform:{redOffset:255}}); ...however all that happens is the last tween immediately overwrites the previous two. If I add "overwrite:0" to the params, then it does the first tween and then flicks to the last two seconds of the second tween (losing the value of the first tween, so in this case blueoffset seems to revert to 0 and I see the end of the greenoffset tween), and likewise with the third (both blue and green to zero, red tweens to 255). No doubt this is me misunderstanding the mechanics of ColorTransform, but if I put them all into one tween, it works - however I would like them to stagger (altho start at the same time). I know, for example, that "exposure" is a combined controller of these three values, but I thought individually they could be tweened independently? Any help appreciated! Thanks, Olly
  3. ...er, so after mentioning it to someone who knows a lot more about ActionScript than me (which is obviously a helluva lot, because remember I am an AS3 genius...), he's pointed out that the new v11 use of Yoyo requires Repeat to also be defined... so it's working now. And, yes, it's true, I'm a complete boob. Who doesn't read the docs properly. Hope this helps others, and thanks again to Mr Greensock and his Fantabulous Tweening Machine...
  4. Hello there, I'm moving some playing cards around a top-down view of a table. I had a tween set to run on the clicking of a card through frame script - two tweens, in fact - one regular (move card to new X & Y coords) and one with a yoyo(scale up, change DSF to give effect of height off the table). This all worked fine. Now I'm putting the same Tweens into a class, so I can just call myCard.throwCard(x,y,etc). The tween calls haven't really changed, but the Yoyo effect in the second tween doesn't work, it just stops at the target values. package { import flash.events.*; import flash.display.Sprite; import flash.filters.DropShadowFilter; import com.greensock.TweenMax; import com.greensock.easing.*; public class card2D extends Sprite { private var startScale:Number = 1.1; private var zoomScale:Number = 1.2; private var myDropShadow:DropShadowFilter = new DropShadowFilter(1,80,0x000000,1,3,3,0.7); public function card2D():void { super(); this.scaleX=startScale; this.scaleY=startScale; this.mouseChildren=false; this.filters = new Array(myDropShadow); } public function throwCard(target_x:Number, target_y:Number, target_rot:Number, tween_time:Number):void { var thisCard = this; var targetX = target_x; var targetY = target_y; var targetRot = target_rot; var tweenTime = tween_time; TweenMax.to (thisCard, tweenTime, {x:targetX, y:targetY, rotation:targetRot, ease:Cubic.easeOut}); TweenMax.to (thisCard, (tweenTime/2), {scaleX:zoomScale, scaleY:zoomScale, dropShadowFilter:{color:0x000000, alpha:1, blurX:12, blurY:12, strength:0.7, angle:80, distance:6}, yoyo:true}); } } } There must obviously be something wrong with TweenMax, because I am an AS3 genius and I never make mistakes. (...ahem...!) ...I mean, of course, any help greatly appreciated. Thanks (oh, and awesome work, Jack). Olly EDIT: I've just rolled back to an old version of TweenMax (was using 11.12, rolled back to 10.12), and now it works. Pretty sure I was using v11 at some point with it working, altho which subversion I'm not sure. Any ideas? EDIT 2: Despite my weak attempt at sarcastic humour in the above post, I think this actully might be a TweenMax issue after all ( I did update around the time I was converting my code to a class)... And I promise to stop adding 'edits' to my post (sorry!)
×
×
  • Create New...