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. Hi I need to rollover an object which makes another invisible object become visible using an alpha tween. When I rollout the latter becomes invisible again. I am using Tweenlite for AS2. Can someone please point me to a good tutorial for this or send me the script. I'm new at this and don't understand the overwrite property too well. Many Thanks
  2. Nope, delayedCalls always have their overwrite set to false, so you don't need to worry about any overwriting occurring. And remember that overwriting is only a factor when there are multiple tweens of the SAME OBJECT. It's not as though you can only have one tween going at any time - TweenLite/Max only consider tweens of the same object when doing overwriting. Yep, that'd work. There are several reasons to use delayedCall() instead of setTimeout or Timer: 1) There are bugs in Flash's setTimeout(), especially on the Mac platform 2) All delayedCalls to a particular function can easily be canceled with TweenLite.killDelayedCallsTo(myFunction). To do that with a setTimeout() or Timer would require you to keep references to each one and manually cancel them all (much more cumbersome). 3) delayedCall() will perform better because the timing mechanism is built into the core TweenLite class. Every Timer instance you create has its own timing mechanism, so the more Timers you have, the more duplicated logic Flash must run, slowing it down.
  3. wait a minute, you want to say that this 3 lines make 3 tweens? TweenLite.delayedCall( _shiftTime + _lineItems * _delay, _filter.dispose ); TweenLite.delayedCall( _shiftTime + _lineItems * _delay, controlIndex, [ - _lineItems ] ); TweenLite.delayedCall( _shiftTime + _lineItems * _delay, checkButtons ); i didnt know that, i thought this was treated like a "normal" 3 function calls in a row... thats why i was having all these problems.... on more thing: does this mean that delayedCall can even overwrite my for loop? (or the last occurence in my foor loop) so if i had these 3 lines written like that what would be their executing order? and if i want to do this like i intended then it should look like this? TweenLite.delayedCall( _shiftTime + _lineItems * _delay, _filter.dispose ); TweenLite.delayedCall( _shiftTime + _lineItems * _delay + 0.001, controlIndex, [ - _lineItems ] ); TweenLite.delayedCall( _shiftTime + _lineItems * _delay + 0.002, checkButtons ); now i wonder whats the actuall gain in using delayed calls instead of (not so) simple timer or setTimeout...
  4. Sure, you can have multiple tweens of the same object going at the same time. Did you remember to import the Linear easing class? If not, that's definitely what's causing the slowdown at the end (the default ease is a Quad.easeOut). Make sure you've got import com.greensock.easing.*; at the top. As far as having two tweens going, I'd recommend using OverwriteManager in AUTO mode for the most convenience (see http://blog.greensock.com/overwritemanager/) but you could just set overwrite:false on your 2nd tween to keep it from overwriting the first one without OverwriteManager. The other possibility is that as the scale gets larger, the Flash Player is having a harder time rendering the graphics which could make it appear to slow down even though there is no easing happening. Hope that helps.
  5. Greensock, thanks for your help, but I am a little lost. Your explanation makes sense to me as far as the tweening on the "current" value being the problem. When you say "create it ahead of time" how would I do that? Could you give me an example of how I would do that? I tried placing "_mytween = new TweenLite(myMC, 0.25, {scaleX:1.5, scaleY:1.5});" in my constructor, but it doesnt know the myMC value so it gives me an error. Where else could I place it to create it ahead of time? Thanks for taking the time to help. my Rooms.as class file again: package { import flash.display.*; import flash.events.*; import com.abrahamyan.liquid.ToolTip; import com.greensock.*; import com.greensock.easing.*; public class Rooms extends MovieClip { private var tooltip:ToolTip=ToolTip.getInstance() var myMC:MovieClip; var priorMC:MovieClip; private var _mottween:TweenLite; private var _revtween:TweenLite; private var _mytween:TweenLite; public function Rooms( ) // constructor { addEventListener(MouseEvent.ROLL_OVER, mouseOverListener); addEventListener(MouseEvent.ROLL_OUT, mouseOutListener); addEventListener(MouseEvent.CLICK, clickListener); OverwriteManager.init() //addEventListener(Event.ENTER_FRAME,move); } // end constructor function mouseOverListener(evt:MouseEvent):void { gotoAndStop("over"); var over_name=evt.target.name; evt.target.alpha=.3; var act_type:String="over"; var icon_type:String="plant"; //ParseempData(xmlData,over_name,act_type,icon_type); //trace("mouseOverListener method Rooms class"); tooltip.followMouse=true; tooltip.fixedWidth=150; tooltip.multiLine=true; tooltip.show("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut sodales placerat ligula. Proin elementum, ante vel consectetur pharetra"); myMC=MovieClip(evt.target); //_tween = new TweenLite(evt.target, 0.25, {scaleX:1.5, scaleY:1.5, overwrite:3}); _mytween = new TweenLite(myMC, 0.25, {scaleX:1.5, scaleY:1.5}); _mytween.play(); } function clickListener(evt:MouseEvent):void { //setBlank(); myMC=MovieClip(evt.target); trace(myMC); gotoAndStop("over"); var over_name=evt.target.name; var act_type:String="click"; var icon_type:String="plant"; trace("clickListener method Rooms class"); var newValx:Number; var newValy:Number; newValx=60; newValy=95 _mottween = new TweenLite(myMC, 1, {x:newValx,y:newValy, ease:Back.easeIn}); //trace(priorMC); priorMC=myMC; trace(priorMC); } function mouseOutListener(evt:MouseEvent):void { //gotoAndStop("out"); evt.target.alpha=1; tooltip.hide(); //trace("mouseOutListener method Rooms class"); _mytween.reverse(); } } // end class } // end package
  6. Aha. I see now. That worked. Thank you. However, I have some sort of conflict that is causing the reverse function to not carry out completely in some circumstances. I have 3 rectangles (right next to each other) on stage with a baseclass = Rooms, which is what my Rooms class is for: package { import flash.display.*; import flash.events.*; import com.abrahamyan.liquid.ToolTip; import com.greensock.*; public class Rooms extends MovieClip { private var tooltip:ToolTip=ToolTip.getInstance() var myMC:MovieClip; private var _tween:TweenLite; private var _mottween:TweenLite; public function Rooms( ) // constructor { addEventListener(MouseEvent.ROLL_OVER, mouseOverListener); addEventListener(MouseEvent.ROLL_OUT, mouseOutListener); addEventListener(MouseEvent.CLICK, clickListener); //addEventListener(Event.ENTER_FRAME,move); } // end constructor function mouseOverListener(evt:MouseEvent):void { gotoAndStop("over"); var over_name=evt.target.name; evt.target.alpha=.3; var act_type:String="over"; var icon_type:String="plant"; //ParseempData(xmlData,over_name,act_type,icon_type); trace("mouseOverListener method Rooms class"); tooltip.followMouse=true; tooltip.fixedWidth=150; tooltip.multiLine=true; tooltip.show("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut sodales placerat ligula. Proin elementum, ante vel consectetur pharetra"); myMC=MovieClip(evt.target); _tween = new TweenLite(evt.target, 0.25, {scaleX:1.5, scaleY:1.5}); } function clickListener(evt:MouseEvent):void { //setBlank(); gotoAndStop("over"); var over_name=evt.target.name; var act_type:String="click"; var icon_type:String="plant"; trace("clickListener method Rooms class"); var newVal:Number; newVal=-600; _mottween = new TweenLite(evt.target, 3, {x:newVal}); } function mouseOutListener(evt:MouseEvent):void { //gotoAndStop("out"); evt.target.alpha=1; tooltip.hide(); trace("mouseOutListener method Rooms class"); _tween.reverse(); } } // end class } // end package If I rollover each rectangle several times, at various speeds, sometimes, one or more of the rectangles appears to not finish it's reverse myTween function(in the mouseOutListener function) so it stays large. I have looked into adding the overwrite manager parameter, but I have not been able to get it to work correctly. I have tried overwrite 0-5 and the issue persists. _tween = new TweenLite(evt.target, 0.25, {scaleX:1.5, scaleY:1.5, overwrite:4});
  7. Absolutely - just create a separate tween for each property (each tween can only have one ease). No need to set a special overwrite property in TweenMax - it uses the AUTO mode by default which is smart enough to analyze each tween and only kill overlapping properties of the same object that are running at the same time.
  8. Hi, I have a project where we're using TweenMax to move a papervision object. We want to move the x, z and rotation properties of a single object simultaneously but with different easing for each of the properties. Is there an easy way to do this? We're trying to use the Overwrite features but nothing seems to be working. Any help is appreciated.
  9. A tween by its very nature must have a duration since it takes a property from value a to value b over a certain amount of time. When there is no time defined, there's no way for it to know how much change to implement each frame/second/update. Also, it looks like you're using dynamicProps incorrectly - each property inside the dynamicProps object should be associated with a function but you're hard-coding numeric values instead. Like: TweenLite.to(mc, 2, {dynamicProps:{x:getMouseX, y:getMouseY}}); function getMouseX():Number { return this.mouseX; } function getMouseY():Number { return this.mouseY; } You could do an ENTER_FRAME that keeps recreating the tween while the mouse is over the object, making it get closer and closer to its destination without ever hitting it, and when you rollout, just remove the ENTER_FRAME listener. Just a thought. Oh, and I'd make sure overwrite is true for those tweens (unless you have other tweens of the same object that need to keep going) - this would improve performance a bit.
  10. Hi, I had a simple fadeIn, fadeOut effect in a text, but after updated from V11 BETA to the final, that effect doesn't work as spected. I tried a lot of things but never works. Here is the code: TweenMax.to(this.mc, duration, {alpha:1, yoyo:true, repeat:1, overwrite:true}); I wan't only a simple fadde In, and later a fadeOut of a text, and I see the effect, but later the alpha of the mc is set to 1 mysteriously. Thanks!
  11. Of course! You have complete control over where your tweens get placed with the insert() method. Put them wherever you want. Keep inserting or appending as much as you want. The tweens can overlap or not. There can be large gaps of time between them if you want. Really, there's no limitations (at least none that I can think of). You can even move a tween by altering its"startTime" property. Tons of flexibility. So if you want to insert a tween at exactly 3.1 seconds into myTimeline, do: myTimeline.insert( new TweenLite(mc, 1, {x:100}), 3.1); Hope that clears things up. Check out the documentation at http://www.greensock.com/as/docs/tween/ Have fun. PS You don't need to set overwrite:false on all those tweens. TimelineLite automatically inits OverwriteManager which sets the overwite mode to AUTO. Be very careful about setting overwrite:false because you're telling the engine to turn off all its features that prevent conflicting tweens.
  12. Hey, Is there anyway that the tweens inside a timeline can govern their own times? below I have add the code I am working with. I understand that the 0.2 at the end staggers the tweens but the thing is I need my tweens to start at different times. Am I missing something or is this an impossible task? var PageTimeLine:TimelineLite = new TimelineLite(); PageTimeLine.insertMultiple([ new TweenLite(background2, 0.40, {x:444.9,y:229.7,width:156.2,height:119.2,ease:Sine.easeOut}), new TweenLite(background2, 1, {delay:0.40,overwrite:false,x:52.5,y:25.3,width:940.9,height:718.4,ease:Elastic.easeOut}), new TweenLite(hometab, 0.1, {delay:1.40,overwrite:false,x:90.5,y:62.2}), new TweenLite(hometab, 0.20, {delay:2,overwrite:false,alpha:100,x:15.4,y:62.2,ease:Sine.easeOut}), new TweenLite(animationtab, 0.1, {delay:1.40,overwrite:false,x:97,y:69.5}), new TweenLite(animationtab, 0.40, {delay:2,overwrite:false,alpha:100,x:22.1,y:69.5,ease:Sine.easeOut}), new TweenLite(illtab, 0.1, {delay:1.40,overwrite:false,x:99.5,y:112.5}), new TweenLite(illtab, 1, {delay:2,overwrite:false,alpha:100,x:24.4,y:112.5,ease:Sine.easeOut}), new TweenLite(abouttab, 0.1, {delay:1.40,overwrite:false,x:101.8,y:155.8}), new TweenLite(abouttab, 1.10, {delay:2,overwrite:false,alpha:100,x:26.9,y:155.8,ease:Sine.easeOut}), new TweenLite(contacttab, 0.1, {delay:1.40,overwrite:false,x:104.2,y:187.1}), new TweenLite(contacttab, 1.40, {alpha:100,x:29.2,y:187.1,ease:Sine.easeOut})], 0, TweenAlign.START 0.40);
  13. Are you saying that you've got nested MovieClips that won't tween when their parent is tweened? I think there must be something else going on. Are you tweening any other properties of those nested clips? Please keep in mind that the transformAroundCenter tweens will overwrite (or be overwritten by depending on the order in which you call them) other x/y/scaleX/scaleY/rotation/width/height tweens of the same object. This is because whenever you update the transform.matrix property, it affects ALL of those properties (x/y/scaleX/scaleY/rotation/width/height). So you can't, for example, have an x/y tween and also a transformAroundCenter one on the same object at the same time. Does that help?
  14. 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
  15. Remove the () from function name so it doesn't fire right away. Good TweenLite.to(peopleContainer.peopleHdr, .5, {y: (peopleContainer.peopleHdr.y+75), alpha:1, overwrite:3, onComplete: toggleVisibility}); Bad TweenLite.to(peopleContainer.peopleHdr, .5, {y: (peopleContainer.peopleHdr.y+75), alpha:1, overwrite:3, onComplete: toggleVisibility()});
  16. Hello there, First, TweenLite is the fastest tweener ever GREAT JOB! i use your delightful library exclusively. Thank you so much! Second, sometimes when using TweenLite, my onComplete functions fire immediately, ie: TweenLite.to(peopleContainer.peopleHdr, .5, {y: (peopleContainer.peopleHdr.y+75), alpha:1, overwrite:3, onComplete: toggleVisibility()}); this statement is unfortunately toggling the visibility before the tween even starts in reading the forums, it seems there is a scoping issue in Actionscript 2 but explicitly not so for AS3 and as this is AS3, i wanted to reach out and check with you. Thanks again for the great free fast code! ~Owen Corso ored.net
  17. Wow, I wasn't expecting a response from you so soon. I figured I'd hear from you this afternoon maybe. 1. All dots the same name: clumsiness born of repetitive code modifications to solve the current problem; added "+ i". 2. tweens in a TimelineLite: so that I could use remove(); trying to make sure tween was removed in case garbage collection didn't occur. Removed the TimelineLite var. 3. dumpClips(): attempt to solve overloading problem; only way I could think of to dump the clips. Removed it. 4. I need to use allFrom() because allTo() would only allow me to move all the dots to the same location. I define the ending location of each dot on the root by rotating a line mc and getting the width and height. I would prefer to use allTo(), but my trig abilites are well beyond rusty. I didn't mean to imply that TweenMax was the problem. I think my code is the problem, and maybe there's more I can do to optimize. I tried loading the dot mcs on the root and reusing them each time the tween is called but there is no performance difference. The tween that I included in the code block is called from another tween. So here are both of them with updates to my previously posted code. If you have time to review and comment, I'd sure appreciate it. function movedot():Void { for(var i:Number = 0; i < 16; i++){ dot_mc = this.attachMovie("dot", "dot" + i, getNextHighestDepth()); dot_Array[i] = dot_mc; dot_Array[i]._alpha = 0; // _root.xcd_Array and _root.ycd_Array contain ending values for each dot_Array[i] dot_Array[i]._x = _root.xcd_Array[i]; dot_Array[i]._y = _root.ycd_Array[i]; } TweenMax.allFrom(dot_Array, 1, {_x:0, _y:0, _alpha:100, ease:Linear.easeNone, overwrite:false}); } // on _root //( leader_mc is a 2px circle that moves to a random x,y and calls movedot() onComplete ) var leader_Timeline:TimelineLite = new TimelineLite; leader_Timeline.append(new TweenLite(leader_mc, 1, {_x:aimPoint_x, _y:aimPoint_y, ease:Linear.easeNone, overwrite:false})); leader_Timeline.insert(new TweenLite(leader_mc, 1, {bezierThrough:[{_x:midpoint_x, _y:midpoint_y}, {_x:endPoint_x, _y:endPoint_y}], _alpha: 0, ease:Linear.easeOut, overwrite:false, onComplete: movedot}), .4); leader_Timeline.insert(new TweenLite(leader_mc, .5, {ease:Linear.easeNone, overwrite:false, onStart: playSound}), .2);
  18. I've been trying for about a week to get this fairly simple animation to run without overloading my old machine's CPU (1.8 gz, 1.5g RAM). A recent test on a machine with 2.4 gz and 4g RAM gave similar results. I know I'm doing something wrong but I sure need some help to figure out what it is. I launch the same tween with each click so a rapid clicker can launch as many as 5 tweens per second. Each tween has a duration of 1and all run well until about 5 rapid clicks, then everything starts to slow down. If I click about 20 times the animation stops for about 10 seconds, starts again, and then finishes the tweens that I launched. But, if I start clicking again then all the tweens start out dog slow and my machine stalls. So it looks as if my code is maybe using up all my RAM. The tween below uses a 2 px dot (attached 16 times) and moves each one radially so that it looks like an expanding cirlce of dots. Am I simply being too ambitious with the tweens? Also, does "TweenMax.allFrom" actually run a separate tween for each object in it's assigned array? Is it more efficient than running a separate tweenLite for each array object? var dot_Array:Array = new Array(); var dot_mc:MovieClip; var dot_Timeline:TimelineLite = new TimelineLite; function dumpClips():Void { for(var i:Number = 0; i < 16; i++){ removeMovieClip(dot_Array[i]); } remove(dot_Timeline); } function movedot():Void { for(var i:Number = 0; i < 16; i++){ dot_mc = this.attachMovie("dot", "dot", getNextHighestDepth()); dot_Array[i] = dot_mc; dot_Array[i]._alpha = 0; // _root.xcd_Array and _root.ycd_Array contain the ending positions for each dot dot_Array[i]._x = _root.xcd_Array[i]; dot_Array[i]._y = _root.ycd_Array[i]; } dot_Timeline.append(new TweenMax.allFrom(dot_Array, 1, {_x:0, _y:0, _alpha:100, ease:Linear.easeNone, overwrite:false, onComplete: dumpClips}, 0)); }
  19. I'm confused - you want to allow multiple tweens to control the same property of the same object? Maybe you're wanting to use a variable to track the destination y value and always append amounts to that variable on the new tweens. In other words, if every time I click a button, it should tween down 10 pixels, and I click 5 times really fast, you want the last tween to make it move down 50 pixels total (from where it was at the beginning). If that's the case, use a variable. Kinda like this: var destinationY:Number = mc.y; //current position. function clickHandler(e:MouseEvent):void { destinationY += 10; TweenLite.to(mc, 1, {y:destinationY, overwrite:true}); }
  20. Thanks for quick answer. I think I should have said, that I don´t want to overwrite tweens, because they all need to be done. The tween repeats everytime, when a new box appears. TweenLite.to(box, 0.5, { y:box.y + 100} ); Sometimes the next tween starts within the duration of 0.5. So I´d like to set NONE with the OverwriteManager, but having the problem that it seems not possible with overlapping properties. Ciao Martin
  21. Absolutely! You've got tons of options. Check out http://blog.greensock.com/overwritemanager/ (although the names have changed slightly in v11). You probably just want to set overwrite to true or use the AUTO mode in OverwriteManager by calling this once in your swf: OverwriteManager.init(2);
  22. Sure, you just forgot to set overwrite to false on the second one. Please see http://blog.greensock.com/overwritemanager/ for details on overwriting modes. TweenLite.to(mc,1,{ _x:20, ease:Quart.easeOut}); TweenLite.to(mc,1,{_y:80, ease:Quart.easeIn, overwrite:false});
  23. Thank you for your time, and also thank you very much for getting back to me in my previous question. If its any consolation, I am learning quickly - and if it wasn't for the fact that I really like to construct my site using loadMovie then this would not be so critical for me to get right. I anticipate once I get this, then happy days and I will never be stuck at this point again; nor will anyone else in the future if this exchange becomes a swift reference point for such questions re loadMovie. I understand the logic of flash - the syntax often escapes me, but I am learning by doing. So I separated the functions (at least I hoped I had): var pause_one_loading:TweenMax = new TweenMax.to.delayedCall(10.0,load_one); function load_one():Void { _root.loader_mc.loadMovie("pages/one.swf"); } and then I call it from: one_mc.onRelease=function(){ TweenMax.to(_root.band_mc,0.3,{_height:0.25, yoyo:1, overwrite:1}); load_one.play(); } But that may well, strictly speaking, be a nested function of sorts, so next I tried to assign two clearly separate functions to the same event: one_mc.onRelease=function(){ load_one.play(); } one_mc.onRelease=function(){ _root.loader_mc.loadMovie("pages/one.swf"); } Both times I get the same error, "there is no method with the name 'play'" I know you have enough of a drain on your time to refer questions about loadMovie and tween clashes elsewhere, but perhaps this exchange can be quickly referred to in future questions regarding delaying a loadMovie call? I had no idea that delayed.Call existed, and it is a godsend. I have skimmed the documentation but my eye was geared towards tweening rather than anything else. Best regards, LF
  24. Hi, I have a newbie problem, (and the miracle for me with greensock tweening is that I don't have a lot more of them). In order to avoid loadmovie and a tween from causing unwanted things happening, I put my loadMovie in a function that uses delayedCall - this is AS2, btw - one_mc.onRelease=function(){ TweenMax.to(_root.band_mc,0.3,{_height:0.25, yoyo:1, overwrite:1}); TweenMax.to.delayedCall(1.0, loadOne); function loadOne():Void { _root.loader_mc.loadMovie("one.swf"); } }; The tweens (there are a series of these clips on the page) work brilliantly. Unfortunately the loadMovies aren't loading any swf's. They all load via a single empty mc, if that has any bearing. If anyone can help me on this I would be very very grateful. I would make a concerted effort to search deeper rather than ask here, but I promised my girlfriend that I wouldn't work this evening, and I need to make a flying start to tomorrow as a result of not working this evening. * Thank you* all very much for your kindness and your time.
  25. Yep, there's a much more efficient way to do that. Like: var logo:DisplayObject; for (var i:int = 1; i logo = this.getChildByName("logo" + i); TweenLite.from(logo, 2, {alpha:1, width:1, height:1, x:360, y:270, delay:Math.random()}); TweenLite.to(logo, 2, {alpha:0, width:1, height:1, x:360, y:270, delay:7 + Math.random(), overwrite:false}); }
×