Jump to content
Search Community

Search the Community

Showing results for tags 'particle generation'.

  • 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

Found 1 result

  1. Hi, I am new to particle generation animation, and I was wondering if I could use TweenLite to make the movement more fluid with eases. If I don't need TweenLite or can't use it any alternative would be appreciated. I did a few tutorials and came up with this code for a snowing animation. I think I could ease with a sin function, but I'm not sure of where to put it in my math and I would rather use the default ease in TweenLite package { import com.greensock.TweenLite; import com.greensock.easing.*; import flash.display.MovieClip; import flash.events.Event; import flash.utils.Timer; import flash.events.TimerEvent; public class Snow extends MovieClip { private var flakesVector:Vector.<MovieClip> = new Vector.<MovieClip>(); private var timer:Timer = new Timer(2000); public function Snow(speed:int = 3, flakesNumber = 150):void { for(var i:int = 0; i < flakesNumber; i++) { var flake:Snowflake = new Snowflake(); flake.vel = (Math.random() * speed) + 0.5; flake.xSpeed = Math.floor(Math.random() * (0.5 - -0.5 + 1)) + -0.5; flake.scaleX = (Math.random() * 1) + 0.3; flake.scaleY = flake.scaleX; flake.x = Math.random() * stage.stageWidth; flake.y = Math.random() * stage.stageHeight; addChild(flake); flakesVector.push(flake); } addEventListener(Event.ENTER_FRAME, fall); timer.addEventListener(TimerEvent.TIMER, changeMovement); timer.start(); } private function fall(e:Event):void { for(var i:int = 0; i < flakesVector.length; i++) { flakesVector.x += flakesVector.xSpeed; flakesVector.y += flakesVector.vel; if(flakesVector.y > stage.stageHeight) { flakesVector.x = Math.random() * stage.stageWidth; flakesVector.y = -flakesVector.height; } } } private function changeMovement(e:TimerEvent):void { for(var i:int = 0; i < flakesVector.length; i++) { flakesVector.xSpeed *= -1; } } } }
×
×
  • Create New...