Jump to content

Search the Community

Showing results for tags 'TweenLite'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge


  • Learning Center
  • Blog


  • Products
  • Plugins


  • Examples
  • Showcase


  • FAQ


  • ScrollTrigger Demos


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Personal Website



Company Website



  1. Hi all, Currently TweenLite marks completed tweens for garbage collection by setting gc=true. This gc var is later detected by the enterFrame function and the tween is removed from the masterList array using splice. Is there any specific reason its done like this? Could this not have been done directly in the complete() function? Thanks
  2. Hi, What is the difference between TintPlugin and HexColorsPlugin? HexColors says it tweens colors so they "look correct", does tint plugin use a dumber version of the same? Thanks
  3. Hi all, I wanted to know how the EndArrayPlugin is different from the regular TweenLite? Comparing: var myArray:Array = [1,2,3,4]; TweenLite.to(myArray, 1.5, [10,20,30,40]); And the alternate EndArray syntax: var myArray:Array = [1,2,3,4]; TweenLite.to(myArray, 1.5, {endArray:[10,20,30,40]}); How would that be different? And I looked at the code in EndArrayPlugin, it supports round on/off which TweenLite does not? Is that the only difference or is there more? They both work, I've tested them.
  4. Hi all, This is more of a technical question, but anyways. I noticed that the "masterList" Dictionary object is cached in a local var before iterating through it. Why is this? Is there any speed benefit? var ml:Dictionary = masterList; var tgt:Object; for (tgt in ml) { I was just curious if this was needed. Thanks.
  5. Alan

    bezier in javascript

    Hi, I wonder if we will have bezier support in javascript version soon? I had a great success with greensock and easelJs together, I can almost 100% duplicate what I have done with actionscript 3 before, apart from bezier curve animation...
  6. I'm trying to figure out the best practice for an image swap. I'm coming from AS, new to JS, but I have a basic idea of what to do -- and nothing seems to work. I'm trying to use the old 'make a UL inline for a horizontal menu' trick -- I ran through all of these options but couldn't get any to work 1) loaded both images into the <li> with different z-indexes, thinking that I'd TweenMax the top image to 0 opacity on rollover -- even with float:left they sat next to each other not on top of each other. 2) I set the "over" image as the background with CSS and put the "out" image in the <li> and then tweened the "out" image to 0 opacity on rollover. Somehow this seemed to collapse the box -- the background image wasn't displayed when the front was invisible -- this seemed to be a result of the 'display:inline' The easiest thing is to simply swap 'src' on rollover -- but I'm looking for a gradual transition. Any suggestions? I know it's hard to talk about what I'm doing/not doing without my code, but in lieu of that, if someone could provide a sample, or a link, that would be helpful. Thanks!
  7. I am trying to make a flash that has twinkling stars. I thought it would be a simple effect. All I want is the alpha to fade in and out on a randomly generated cycle. And have the AS inside the star so every time I place one it will fade in and out on its own. var cycle:Number = Math.random() * 4; TweenLite.To(mc, cycle, {alpha:0, repeat:-1, yoyo:true}); But I am missing something because it will appear and fade out and not repeat or yoyo. Thanks cH
  8. Hi, I couldnt find an answer to this on the forums. Appologies if a similar thread exists. I am as my name suggests; new to greensock and flash-programming. Current code is working and moves the "hero" up and down to fixed locations in my game: private function keyPressed(event:KeyboardEvent):void { if (oppnedcount <2 && event.keyCode==38) { if (oppnedcount == 0) { oppnedcount++; TweenLite.to(hero, 0.3, {y:(421)}); } else { oppnedcount++; TweenLite.to(hero, 0.3, {y:(365)}); } } if (oppnedcount > 0 && event.keyCode==40) { if (oppnedcount == 2) { oppnedcount--; TweenLite.to(hero, 0.3, {y:(421)}); } else { oppnedcount--; TweenLite.to(hero, 0.3, {y:(477)}); } } } "Attatched" to the heros X- and Y-pos i have a running particle-object. Is there a way to rotate the angle of this particle-object DURING the tween of my "hero"? Preferrably using the tweenlite-code and not adding a timer to calculate the 0.3 seconds of my tweens. Thanks in advance, best regards
  9. I'm trying to create an animation (timelineLite animation) that can be controlled by a scrollbar or scrubber. a perfect example of which, is the demo swfs on the TimelineLite page as well as the TimelineMax page. The scrollbar has to allow the viewer to play the animation forward and scrub the animation in reverse. Thanks in advance!
  10. So I tried searching this on here and stackoverflow too, but can't seem to find the exact same issue. I've drawn an object using shapes on the stage. I grouped everything in a movieclip called "number_mc". After which I wanted to Animate the scaleX and scaleY values of that movieclip like so: var scaleAnim:TweenLite = new TweenLite(nummer_mc, 2.5, {scaleX: 2, scaleY: 2}); or TweenLite.to(nummer_mc, 2.5, {scaleX: 2, scaleY: 2}); But they just don't work, nothing happens, To my believe I'm not doing something different from the dozen times I've done this before. Kind Regards, Shuyinsan PS: I use Flash CS6 btw (in case this matters)
  11. http://forums.greensock.com/topic/6734-tweenlite-does-not-animate/page__gopid__24844#entry24844 What happened, I uploaded a file so someone could take a look but now it's gone...? Did I violate some rule?
  12. Hi. I'm writing a particle tweening script that tweens a bunch of dom elements, which I each give a slightly more delay. Everything looks fine, but when I switch tabs in my browser (chrome, but same in safari) and after that go back to the tab with my particle tweens, the delay seems to be ignored.. All the tweens start at the same time, without the delay! Any idea why this is? If you don't understand what I mean, I could upload the script to my hosting as an example. Oh, and I thought about using timelinelite for this, but I really want the sort of plugin I'm writing to not be dependent of timelinelite, only of tweenlite. Edit: I've uploaded the test project to my webhost so you can see the problem yourself. http://sanderbruggem...cles/index.html Open the page in a tab, then click on another tab, wait a few seconds and go back to the tab with my test project: the particles "explode" now instead of continuously loop.. I think I know why: the first time the tween is played, the delay is taken into account, but then when I call "restart()" on the tween in onComplete, the delay is not added anymore. Which in general is good: the tween already has an offset regarding the other tweens because of the initial delay. However, probably for speed reasons, when navigating away from the page, all the tweens are being reset/paused or whatever, and on focus again all the tweens are played again (but this time without the initial delay, because it practically fires "restart()" but this time on all the tweens at the same time). So my question actually is: what type of event is used to determine if the window/tab is focussed, so I can intercept this (i've had partial success with window.onfocus() and window.onblur()) OR is there maybe another solution for this?
  13. I am trying to create a timeline that is populated with content from an xml source. My questions are: How do I fade out the previous mc for the next mc? How do I restart the whole she-bang after the mcs have been populated? How do I reset the timeline when the xml file is updated? function loadTaglines():void { for ( var i:uint = 0; i < xml.length(); i++ ){ var tagline = new mc; tagline.txt_tagline.text = xml.tagline[i] tagline.x = 816; tagline.y = 47; tagline.scaleX = 4; tagline.scaleY = 4; tagline.alpha = 0; addChild(tagline).name = tagline + i; timeline.append( new TweenLite (tagline, .5, {scaleX:1, scaleY:1, alpha:1) ); } }
  14. Dear Tutors, This is Sanjib i have a flash web banner which has two kind of navigation in it one is "next and previous button" and second one is "Tween Animated Tab navigation at the bottom" you can download the the folder of the banner by clicking on this link "http://www.touchpixl...er1/banner1.rar" . I want to change the dimension "width or height" of the banner, can anyone make the same logic in a banner in flash file format and upload some where or send it to me at "sanjibpersonaldata@gmail.com", you can see the banner here "http://www.touchpixl.com/banner1" I would like to mention that i have lost the flash file of the "holder" file nad without that i am not being able to increase or decrease the dimension of this banner/slide. Thanks in advance Sanjib Das
  15. Hi all, I started routinely using Tweenlite.to() static method instead of a Timer by setting a fake target (like 'this') and just putting a onComplete on the tweenvars object. I dunno if I should, what about the efficiency of that trick? TweenLite.to(this,2,{onComplete:myFunc}); function myFunc() { //My instructions... }
  16. Hi, here is one I hope simple problem. I`m using tweenlite to simple rotate some stuff and then to trigger some sound when wheel reach a certain position: TweenLite.to(_myWheel, _speed, {rotation:_suspension + (_pieIndex * _pieAngle), immediateRender:true, useFrames:false, ease:easeFunct, onUpdate:playTickSound }); private function playTickSound ():void { trace (Math.round(_myWheel.rotation)); _isWhole = (Math.round(_myWheel.rotation) / Math.round(_pieAngle)) % 1 == 0; if (_isWhole) playSimpleSound(); } To exactly calculate _isWhole = true, I need to have Math.round(_myWheel.rotation) exact position every time when onUpdate occurs. Anyways, for some reason I don`t get those info right, so here is what I get when I try to trace it: trace (Math.round(myWheel.rotation)); 139 156 171 -176 -162 -144 -130 -119 -109 -98 -88 -78 -67 -54 -42 -30 -19 -9 1 11 21 30 39 51 63 76 86 95 103 111 118 126 135 143 150 157 165 172 179 -174 -168 -162 -155 -148 -140 -133 -127 -121 -116 -110 -104 -99 -93 -87 -81 -76 -70 -65 -61 -57 -52 -48 -43 -39 -34 -30 -27 -23 -20 -17 -14 -11 -8 -5 -2 0 2 4 5 7 9 11 12 14 15 16 17 18 19 20 21 21 22 22 22 23
  17. I have some code that scrolls a movieClip. The problem is I cannot get the onComplete to fire and remove the listener. It will fire when the clip reaches its bounds but not any time in between. Does my code prevent the tween from completing? import com.greensock.*; import flash.display.MovieClip; var mc:Sprite = new Sprite(); mc.graphics.beginGradientFill(GradientType.LINEAR, [0x666666,0xfff000],[0.9,0.1],[0,255], new Matrix(0,-1,1,0,height,0)); mc.graphics.drawRect(225, 50, 100, 300) addChild(mc); var destination:Point=new Point(); var dragging:Boolean=false; var speed:Number=20; var offset:Point=new Point(); var topLimit:Number = 0 - ( mc.height - (stage.height-50) ); var bottomLimit:Number = 120; mc.addEventListener(MouseEvent.MOUSE_DOWN,startdrag, false, 0, true); stage.addEventListener(MouseEvent.MOUSE_UP,stopdrag, false, 0, true); function startdrag(e:MouseEvent):void{ offset.y=mc.mouseY*mc.scaleY; dragging=true; mc.addEventListener(Event.ENTER_FRAME,followmouse, false, 0, true); } function stopdrag(e:MouseEvent):void{ dragging=false; } function followmouse(e:Event):void{ if(dragging){ destination.y=mouseY; } TweenLite.to(mc, 2, {y:mc.y-=(mc.y-(destination.y-offset.y))/speed, onComplete:removeEFListener}); if(mc.y > bottomLimit){ mc.removeEventListener(Event.ENTER_FRAME,followmouse); TweenLite.to(mc, .6, {y:bottomLimit}); trace('removedBottom'); } if(mc.y<topLimit){ TweenLite.to(mc, .6, {y:topLimit}); mc.removeEventListener(Event.ENTER_FRAME,followmouse); trace('removedTop'); } } function removeEFListener():void{ mc.removeEventListener(Event.ENTER_FRAME,followmouse); trace('removedEL'); } Note: This code is repurposed. I lost the source for the original code and gladly give credit where its due - so if its yours, thanks and good job.
  18. flag468x90.zipHi all While trying out the new v12 GSAP with a small 468x90 banner I noticed the background image shifts a few pixels, like a quick snapping movement once it starts to loop via a label in the timelinelite. Why is this happening? The bg image is img_fundo_mc. Thanks for your help. The code: import com.greensock.*; import com.greensock.easing.*; var tl:TimelineLite = new TimelineLite({onComplete:loopBackground}); tl.append( TweenLite.from(img_flag_mc, .5, {x:"-=100", ease:Power4.easeOut}) ); tl.append( TweenLite.from(img_cursos_mc, .5, {y:"-=100", ease:Power4.easeOut}) ); tl.append( TweenLite.from(img_saber_mc, .5, {alpha:0, ease:Power4.easeOut}) ); tl.append( TweenLite.from(img_fundo_mc, 1, {alpha:0, ease:Power4.easeOut}) ); tl.insert( TweenLite.to(img_fundo_mc, 2, {x:-13, y:-16, scaleX:0.75, scaleY:0.75, rotation:-10, ease:Power3.easeInOut}), "loop"); tl.append( TweenLite.to(img_fundo_mc, 2, {x:-69, y:-168, scaleX:0.90, scaleY:0.90, rotation:10, ease:Power3.easeInOut}) ); tl.append( TweenLite.to(img_fundo_mc, 2, {x:0, y:0, scaleX:1.0, scaleY:1.0, rotation:0, ease:Power3.easeInOut}) ); function loopBackground():void { tl.play("loop") }
  19. I'm writing an app thatdoes a zoom in and out around a point. To do this I registered a callback function that does a matrix transform. Everything is working great except for the fact that the cllback is called an inconsistent number of times. For a 1 second duration at 24 frames per second the function is called between 23-25 times. Is this a bug or should I be doing something different? I would think the number of times the callback is called would be equal to duration * frameRate. Below is the call I am using: TweenLite.to(target, this.duration, {ease:Elastic.easeOut , onUpdate:MotionUtil.zoomOut, onUpdateParams:[ target, scaleIncrement, _origin, _originalScale ], onComplete:onComplete }); Thanks in advance for any help you can offer.
  20. I'm having problems with the code below. For some reason when I export I only see the last tween appear and thats it. I'm using the overwrite manager but I'm not sure if it's working correctly or not. I'm not a advanced Flash user so any help would be greatly appreciated. I have the file attached as well. import com.greensock.*; import com.greensock.easing.*; OverwriteManager.init(OverwriteManager.AUTO); // Intro Animations TweenLite.from (gfx7, 1, { _alpha:0 }); TweenLite.from (statement, .7, { _x:7, _y:175, _alpha:0, _delay:0.5 }); TweenLite.to (statement, .7, { _x:7, _y:175, _alpha:0, _delay:3.5 });