Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Search the Community

Showing results for 'overwrite'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

  1. It's a logic problem in your code. I saw two issues actually: 1) You loop between frames 1 and 2 while preloading, but you don't stop that loop when bytes_loaded == bytes_total, so your code keeps creating tweens over and over and over again which overwrite each other. That's why the onComplete never fires - the tween never completes because it keeps getting overwritten by a new one. Add a stop() inside that condition and you should be okay. 2) You nested 2 of your functions inside of a conditional statement which is pretty weird. I wouldn't recommend doing that.
  2. Hi for some reason TweenLite will not tween a movieclip i tell it to, The linkage and everything else is fine, the movieclip is called dynamically and i can see it on the stage when i run my swf. However if i try and get TweenLite to tween it it wont, even though Tweenlite works fine on. Does it matter if the movieclips are nested in folders in my library? if so how do i target a MC in a folder? heres the code that works (also on many other buttons) var attractionsBg = new Attractions_BG(); attractionsBg.alpha=0; addChild(attractionsBg); TweenLite.to(attractionsBg ,1,{alpha:1, ease:Strong.easeOut, delay:1.5, overwrite:true}); and the code that doesnt work var towerBg = new Tower_BG(); towerBg.alpha=0; addChild(towerBg); TweenLite.to(towerBg ,1,{alpha:1, ease:Strong.easeOut, delay:1.5, overwrite:true}); Heres my library folder set up Attractions > Attractions Menu > MC's > Attractions_BG(); Attractions > Tower > MC's > Tower_BG(); all my code is in 1 actionscript file which is external and linked with the classpath, all the other mcs at a higher level seem to work except this one!?! pulling my hair out!
  3. Hey folks, N00b here. I am having a frustrating time with some roll over buttons I've created. Essentially, when you roll over the button it increases in size and when you roll out they shrink back to their original size. This all works perfectly fine until you quickly roll over and roll out of the button multiple time (like twice or three times a second). When I do this the button either multiplies in size or shrinks and inverts itself. On these multiple rollovers the tweens seem to overlap and therefore the button does not end up in its original position. I'm wondering if this have to do with the Overwrite Management but I can't seem to figure it out. Can anyone please help me with the proper coding so that my button increases and returns to the sizes specified, despite multiple rollovers. Here is my code as it stands: import com.greensock.*; import com.greensock.easing.*; import flash.events.MouseEvent; aboutUsText_mc.addEventListener(MouseEvent.ROLL_OVER, overHandler); aboutUsText_mc.addEventListener(MouseEvent.ROLL_OUT, outHandler); function overHandler(event:MouseEvent):void { TweenLite.to(event.currentTarget, 0.5, {scaleX:"1.5", scaleY:"1.5", ease:Bounce.easeOut}); } function outHandler(event:MouseEvent):void { TweenLite.to(event.currentTarget, 0.5, {scaleX:"-1.5", scaleY:"-1.5", ease:Bounce.easeOut}); } Cheers people, I appreciate your help!
  4. You might want to look into CustomEase: http://www.greensock.com/customease/ Otherwise, you could just sequence two tweens (not sure how you want it to transition between the two): TweenLite.to(mc, 1, {x:30}); TweenLite.to(mc, 3, {x:50, delay:1, overwrite:false, ease:Linear.easeNone}); Other options are: 1) Use the physics2D or physicsProps plugins to define a particular velocity 2) Use the timeScale property of the tween itself. You can even tween the timeScale of a tween with another tween. var tween:TweenMax = new TweenMax(mc, 2, {x:50}); TweenMax.to(tween, 1, {timeScale:0.2, delay:1}); Lots of options
  5. I am making a game in which enemies strut down a path. At each turn in the path I have a movieclip that sets up a tweenMax instance on the enemy clip when the enemy clip makes contact with it. I am using 'shortestRotation' and 'transformAroundPount' on these tweenMax instances and they basically rotate the enemy clip 90 degrees in the appropriate direction. This all works fine and dandy until I go to the 'choose level' screen which basically turns the level container movieclip's visibility to false and the 'choose level' movieclip's visibility to true. Once you select a new level from the chooser, a function nullifies all the arrays and variables populated by the last level and loads the appropriate level into the level container. Now it seems that the Tweens in each subsequent level that is loaded jitter or are jerky at the beginning and end of the tweens. Here is the code I'm using for each tween instance. TweenMax.to(baddie, tweenSpeed, { ease:Linear.easeNone, useFrames:true, overwrite:5, immediateRender:true, onUpdate:addRotToDistanceTraveled, onUpdateParams:[baddie, baddie.rotation], onComplete:resume, onCompleteParams:[baddie], shortRotation:{rotation:rot}, transformAroundPoint:{ point:rPoint, scaleX:1, scaleY:1 } });
  6. TweenMax doesn't run differently in different browsers (unless there's a bug in the Flash Player itself for a particular browser, but I haven't heard of any bugs like that which would affect TweenMax). I glanced at your code and it seems problematic because it would create a LOT of duplicate tweens. Every time a progress event is dispatched as your file is loading, it creates a new tween for the various percentages. For example, let's say it's 20% loaded. It'll create a tint/glow tween for circle 1. Great. Then at 20.2% (or anytime thereafter) it creates that same tween again which will overwrite the previous one. And again and again. Then when it hits 60%, it creates another tween for circle 1, as well as one for circle 2 and also for circle 3. It gets worse as more of the file loads until it's at 100% and it creates 5 tweens. By the time your file has loaded, you may have easily created many hundreds of tweens (depending on how many progress events were dispatched) when all you needed was to create 5. Add trace() statements in there wherever you're creating tweens and I bet you'll see a ton of calls. Maybe I'm wrong, though, because I don't see where you're setting the "tweened" property on your circles. If you set it as soon as it starts tweening the first time, then you're probably fine. If you're still having trouble, please post an example FLA & supporting HTML/JS that clearly demonstrates the issue. I'd recommend simplifying it as much as possible so that you can isolate things and identify whether or not it is related to TweenMax. Oh, and you're using the latest version of the GreenSock classes, right? Definitely make sure you've got the latest & greatest. http://www.tweenmax.com
  7. No such luck using .overwrite variable... NONE = 0, ALL_IMMEDIATE = 1, AUTO = 2, CONCURRENT = 3, ALL_ONSTART = 4, PREEXISTING = 5 As you can see below I added .overwrite as a variable in the TweenLiteVars object. The basic function of this animation is to fade out the login, resize the box, and fade in the registration. It will do one instance of it however when it plays the second animation which fades out registration, resizes, and goes back to login... the Fade in on the login doesn't work. The effects are setup exactly the same so I can't figure out why it's doing this. Also they shouldn't be accessing the same canvas at the same time. One effect sequence plays and completes... Then they have to click another button to go back to login. //Dissolve Registration var dissolveOutVars:TweenLiteVars = new TweenLiteVars(); dissolveOutVars.addProp("alpha", 0); dissolveOutVars.overwrite = 0; dissolveOutVars.ease = Quad.easeOut; dissolveOutVars.onComplete = function():void{ setDimensions(registerCanvas); registerCanvas.includeInLayout = false; registerCanvas.visible = false; }; var dissolveOutTween:TweenLite = new TweenLite(registerCanvas, fadeDuration, dissolveOutVars); Here is the code I created using the built in Flex Effects. This code works for me: private function createRegister():void{ var dissolveOut:Dissolve = new Dissolve(loginCanvas); dissolveOut.alphaFrom = 1; dissolveOut.alphaTo = 0; dissolveOut.duration = fadeDuration; dissolveOut.targetArea = new RoundedRectangle(0,0,loginCanvas.width,loginCanvas.height,8); dissolveOut.addEventListener(EffectEvent.EFFECT_END, function():void{ loginCanvas.includeInLayout = false; loginCanvas.visible = false; } ); var resize:Resize = new Resize(userBox); resize.heightFrom = loginCanvas.height + borderNumber; resize.heightTo = registerCanvas.height + borderNumber; resize.widthFrom = loginCanvas.width + borderNumber; resize.widthTo = registerCanvas.width + borderNumber; resize.duration = resizeDuration; resize.easingFunction = Quadratic.easeOut; resize.addEventListener(EffectEvent.EFFECT_END, function():void{ registerCanvas.includeInLayout = true; registerCanvas.visible = true; } ); var dissolveIn:Dissolve = new Dissolve(registerCanvas); dissolveIn.alphaFrom = 0; dissolveIn.alphaTo = 1; dissolveIn.duration = fadeDuration; dissolveIn.targetArea = new RoundedRectangle(0,0,registerCanvas.width,registerCanvas.height,8); openRegister = new Sequence(); openRegister.addChild(dissolveOut); openRegister.addChild(resize); openRegister.addChild(dissolveIn); } private function createLogin():void{ var dissolveOut:Dissolve = new Dissolve(registerCanvas); dissolveOut.alphaFrom = 1; dissolveOut.alphaTo = 0; dissolveOut.duration = fadeDuration; dissolveOut.targetArea = new RoundedRectangle(0,0,registerCanvas.width,registerCanvas.height,8); dissolveOut.addEventListener(EffectEvent.EFFECT_END, function():void{ registerCanvas.includeInLayout = false; registerCanvas.visible = false; } ); var resize:Resize = new Resize(userBox); resize.heightFrom = registerCanvas.height + borderNumber; resize.heightTo = loginCanvas.height + borderNumber; resize.widthFrom = registerCanvas.width + borderNumber; resize.widthTo = loginCanvas.width + borderNumber; resize.duration = resizeDuration; resize.easingFunction = Quadratic.easeOut; resize.addEventListener(EffectEvent.EFFECT_END, function():void{ loginCanvas.includeInLayout = true; loginCanvas.visible = true; } ); var dissolveIn:Dissolve = new Dissolve(loginCanvas); dissolveIn.alphaFrom = 0; dissolveIn.alphaTo = 1; dissolveIn.duration = fadeDuration; dissolveIn.targetArea = new RoundedRectangle(0,0,loginCanvas.width,loginCanvas.height,8); openLogin = new Sequence(); openLogin.addChild(dissolveOut); openLogin.addChild(resize); openLogin.addChild(dissolveIn); }
  8. It sounds like possibly an overwriting thing - have you tried setting overwrite:false on the alpha tweens of that object to see if that "fixes" it? I put "fixes" in quotes because if it's getting overwritten like that, it means you created overlapping tweens that are fighting for control of the same property of the same object at the same time. I'm running out the door in a sec for a meeting and didn't have time to look at your source, so if this doesn't nudge you in the right direction and you still need help, just let us know.
  9. Hello, I am in desperate need of some help. I believe what I want to do is really easy...however I just cannot figure it out. Basically I have a banner advertisement that has a numbers of tweens, nothing too fancy and I just want it to loop two times and stop. Just like the banner ads you see on websites. I've read, searched and to NO avail can I figure this out on my own. Please help. I would truly appreciate it. Here's my code: import gs.TweenLite; import gs.easing.* //--Welcome TweenLite.from(welcome, 1, {_x:-100, _y:8, _alpha:100}); TweenLite.to(welcome, 1, {_x:-300, _y:26, delay:11.5, overwrite:0, _alpha:0}); //--Better TweenLite.from(better, 1, {_x:-295, _y:-10, delay:1, _alpha:0, ease:Back.easeOut}); TweenLite.to(better, 1, {_x:500, _y:-10, delay:3, overwrite:0, _alpha:0}); //--Responsive TweenLite.from(responsive, 1, {_x:-295, _y:1, delay:4, _alpha:0, ease:Back.easeOut}); TweenLite.to(responsive, 1, {_x:500, _y:1, delay:6, overwrite:0, _alpha:0}); //--FirstMerit TweenLite.from(firstmerit, 1, {_x:-295, _y:1, delay:7, _alpha:0, ease:Back.easeOut}); TweenLite.to(firstmerit, 1, {_x:500, _y:1, delay:11.5, overwrite:0, _alpha:0}); //--More Bank TweenLite.from(more_bank, 1, {_x:438, _y:37, delay:9, _alpha:0}); TweenLite.to(more_bank, 1, {_x:438, _y:115, delay:11.5, overwrite:0, _alpha:0}); //--FM Logo TweenLite.from(fm_logo, 3, {_x:46, _y:8, delay:12.5, overwrite:0, _alpha:0}); //--More Bank TweenLite.from(more_bank_big, 1, {_x:241, _y:29, delay:14, _alpha:0}); //--Get More Button TweenLite.from(button_get_more, 1, {_x:0, _y:21, delay:15.5, overwrite:0, _alpha:0, repeat:2, ease:Back.easeOut}); --------------- All I want it to do is loop back to the beginning of this animation two times and stop. All of my content is on ONE frame. Thank you so much! tb-
  10. i was wrong. it doesnt overwrite filters, what actually happens is: the second time i try to tween the same property, it's value is either unpredictably changed or ignored. i have no idea how to explain it, and i can't seem to find any specific pattern it follows. it happens to filters as well as to simple properties. attached source files, explanation on how to use everything is written on the stage. many thanks
  11. hello! i have made a tool for controlling objects/properties/methods at runtime. it works fine, but i wish to integrate tweenmax so i could easily control complex things like colorMatrixFilter as well. it almost works and about half the time it tweens them, but sometimes it doesnt, and it overwrites filters in a funny unpredictable way etc. i was wondering if someone could help me. this is my code: package { import flash.display.MovieClip; import com.gskinner.utils.StringUtils; import com.greensock.*; public class test extends MovieClip { public var resets:Array = new Array(); public function control(variable:String, property:String, value:String, time:Number = 0, before:String = ""):void { var m = getMC(this, variable); if (before != "" && resets[before] == undefined) { var pre:Object = new Object(); for (var i:String in m) { pre[i] = m[i]; } resets[before] = pre; } if (property.indexOf("Filter") != -1) { var h:Object = new Object(); var n:Object = stringToObject(value); h[property] = n; h["overwrite"] = true; TweenMax.to(m, time, h ); }else if (property in m) { if (m[property] is Boolean) m[property] = Number(value); else m[property] = value; trace(property, ":", m[property]); } } public function getMC(prev:Object, str:String):Object { var m:Object; if (StringUtils.contains(str, ".")) m = getMC(prev[stringUtils.beforeFirst(str, ".")], StringUtils.afterFirst(str, ".")); else m = prev[str]; return m; } public function stringToObject(tString:String):Object { var object:Object = new Object(); var stripped:String = tString.substr(tString.indexOf('{') + 1); stripped = stripped.substr(0, stripped.lastIndexOf('}')); var propArray:Array = stripped.split(','); for (var i:uint = 0; i < propArray.length; i++) { var objectProp:Array = propArray[i].split(':'); var propName:String = StringUtils.trim(objectProp[0]); var propValue = StringUtils.trim(objectProp[1]); object[propName] = propValue; } return object; } public function reset(variable:String, id:String):void { var m = this[variable]; for (var i:String in resets[id]) { m[i] = resets[id][i]; } resets[id] = undefined; } } } thanks! PS if anybody finds this code useful feel free, + if anybody can optimize it in any way please let me know! thanks again, michael
  12. I have a bunch of tweens in one class that control colour when the mouse is interacting with an object (think SimpleButton but with tweened transitions). I also have another class that is responsible for dragging objects, with optional tweening to catch up to the mouse, and tweening returning to the start point when the interaction is finished. However, as the user interacts with the object, the tweens applied by one class end up overwriting the tweens applied by the other. As each class is sealed, they will know nothing of the other's tweens, so using overwrite: is not an option. Is there a built-in way to separate sets of applied tweens into groups, or namespaces, so they don't overwrite each other? Thanks for reading, Dave
  13. It's because of the default overwrite mode. See http://www.greensock.com/overwritemanager/ TweenMax inits OverwriteManager in AUTO mode by default, but TweenLite simply overwrites all existing tweens of the same object. You can get the same behavior as in TweenMax simply by doing this: OverwriteManager.init(2); You only need to do that once in your swf.
  14. Hi there, I am building a website, and using a lot of TweenLite tweens. But sometimes (i.e. for the advanced overwrite manager) I am using the TweenMax tween. That makes me wonder if it is still usefull for me to use TweenLite, or to replace all the TweenLite tweens in TweenMax tweens? Does it matter? PS: thanks "Greensock-man", I am having lots of fun with the use of TweenLite!
  15. Hi, I am using tweenLite to animate in loaded swfs and then reverse them back off stage. I am also using a delay. Everything works great accept, the second time (and there after) I call the tweens, the delay does not delay. Am I doing something wrong or is there a property I can use to initiate delay everytime the tween is called. I am not looking for a delay on reverse, but does reverse have something to do with it? Thank you for any help! //this is relavant code, to show all code would be very long... //works button tweens var openWorksTween:TweenMax = new TweenMax(worksSprite, 0.5,{x:"1274", y:"0", ease:Quart.easeInOut,overwrite:false, delay:0.6, paused: true, onComplete:openCW}); //When I click this the second time, no delay... works_btn.addEventListener(MouseEvent.CLICK, worksIn); function worksIn(e:MouseEvent):void { if(worksSprite.x < -1200) { openWorksTween.play(); } } blog_btn.addEventListener(MouseEvent.CLICK, blogIn); function blogIn(e:MouseEvent):void { if(worksSprite.x > -100) { openWorksTween.reverse(); } }
  16. Hello Why can I make it work? TweenLite.to(zlate_z, 3, {x:-185.7, y:0, rotationX:100, rotationZ:50, ease:Bounce.easeOut}); TweenLite.to(zlate_z, 1, {rotationX:0, rotationZ:0, delay:2, overwrite:false}); First line is working but not the second one. Second Q: Can I set the start and end like in Tween? Thanks
  17. There are a lot of ways to accomplish it, but here's one: var overTween:TweenLite; private function buttonRollOver(e:Event):void { overTween = new TweenLite(e.target.buttonTxt, 1, {tint:e.target.txtColorOver, ease:Quad.easeOut, overwrite:1}); } private function buttonRollOut(e:Event):void { var timeLeft:Number = overTween.duration - overTween.currentTime; TweenLite.to(e.target.buttonTxt, 1, {tint:e.target.txtColor, delay:timeLeft, ease:Quad.easeOut, overwrite:0}); }
  18. Hi, Is it possible to have a tween finish before a new one starts? I have some buttons and I would like the roll over effect to always complete before the roll out effect overwrites it. I have tried all of the overwrite properties, but nothing achieves the effect I am after. here is my simple code: private function buttonRollOver(e:Event):void { TweenLite.to(e.target.buttonTxt, 1, {tint:e.target.txtColorOver,ease:Quad.easeOut}); } private function buttonRollOut(e:Event):void { TweenLite.to(e.target.buttonTxt, 1, {tint:e.target.txtColor,ease:Quad.easeOut}); } } thanks, Gareth
  19. Nope, no special delay or overwrite stuff happening. New tweens do overwrite existing ones, but that's just the default anyway. Define "not smooth". Is your frame rate really low or something? Feel free to post an example that looks non-smooth (don't forget to zip before you post)
  20. from looking i can't say ain't there some delay/overwrite action taking place? when i try a simple tint and alpha tween on rollover/rollout it doesn't look that "smooth"...
  21. oops, i guess i mixed things up. obviously the overwrite would cause the exact opposite effect. thanks! nevertheless, the effect in the plugin explorer does not look like a simple tint and alpha tween... what's the trick that makes it look like it looks?
  22. Why would you want overwrite:false? Imagine you roll over an item and it starts tweening to green, and then you roll out and it starts tweening to red - if you set overwrite:false, that means that the green tween is allowed to continue, so now you've got two tweens fighting with each other over the tint of the object. And if you roll over it again quickly, now you've got 3 tweens fighting. Whichever one executes last wins. Maybe that's causing the "stuttering" effect you're seeing. My recommendation would be to leave overwrite as either 1 (true) or the AUTO mode which is 2. See http://www.greensock.com/overwritemanager/ for details about all the different modes, behaviors, and requirements.
  23. hi all, i'm trying to do that kind of "wave" effect for the list-items as used in the tweenlite/max plugin explorer: like roll-over/roll-out on an item but completing the tween (no overwrite) after you rollover/out. i'm using a simple tint tween on the background color of each item and a 'overwrite: false' on the items rollover/rollout event. somehow the result isn't what i expected, because it seems to "stutter". anyone has an example handy on how to do this kind of effect? thanks: lars
  24. This was the code I used: TweenLite.to(copy2_mc.copy2c_mc, .2, {tint:0xffffff, delay: 1.3, overwrite:0}); TweenLite.to(copy2_mc.copy2c_mc, .4, {tint:null, delay: 1.45, ease:Sine.easeOut, overwrite:0}); Yeah, I guess it only adds another K, unfortunately, I'm squeezing a square box through a round hole with this one. Just too small. Heck, my AS3 classes weigh 11k. That's so much. I should've probably just tried to frame animate the thing (which I hate doing, but this is an exception). Between AS3, reunifying myself with TweenLite, and dealing with the creative restraints, I'm pretty much stuck without it. Thanks though. So TweenLite Plugin Object Class is used for all TweenLite stuff now right?
  25. I don't have time to analyze all of your code right now (that was a lot), but I'm wondering if it may just be a timing issue with when you are appending your stuff. Are you expecting the TimelineLite/Max to play fully, then stop at the end, and then if/when you append another tween, it picks up from there? If so, that's not how it works - every TimelineLite/Max has a parent timeline (by default, it's the TweenLite.rootTimeline) and each one has a specific startTime on that parent. So imagine a virtual playhead zooming across the parent timeline, playing your TimelineLite/Max as it goes. If it reaches the end of your TimelineLite/Max, it keeps going. So let's say it reached the end of your TimelineLite and has proceeded 5 seconds after it and then you append() a 2-second tween to your TimelineLite/Max - you'll never see it play because the virtual playhead has already blown past the ending of your TimelinLite/Max by 5 seconds. See what I mean? Of course you can always restart() your TimelineLite or jump to a specific spot with gotoAndPlay() or by setting the currentTime property. Those essentially adjust its startTime according to the parent's currentTime. I also noticed that a lot of your tweens are not in the TimelineLite/Max, so watch for overwriting. If, for example, you're tweening myObject's x property in the timeline (which is running currently) and then you fire off a standalone tween of myObject's x property - if both are trying to fight over the same property of the same object, the newest one will overwrite the other(s). Hope that helps.
×