Jump to content

# Search the Community

Showing results for tags 'recursive'.

• ### Search By Tags

Type tags separated by commas.

### Forums

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

### Product Groups

• Club GreenSock
• TransformManager

• FAQ

• Examples
• Showcase

• Products
• Plugins

### Categories

• Learning Center
• Blog

### Categories

• ScrollTrigger Demos

### Categories

• CodePen Challenges

• 0 Comments

• 0 Replies

• 0 Reviews

• 0 Views

Found 1 result

1. ## Randomizing doesn't change in recursion

I'm trying to randomize some settings in a tween. The first time it gets random values, but each iteration thereafter is identical. function RandomTween(e,o,w,h){ TweenMax.to(e, 0, {x:(int(o.left*w)), y:(int(o.top*h)),rotation:getRandomArbitary(1.05,6.25)+"rad"}); TweenMax.to(e, getRandomArbitary(0.5,5), {y: o.animation.to.y*h,repeat:-1,x: o.animation.to.x*w,force3D:true, rotation:getRandomArbitary(1.05,6.25)+"rad",ease:Linear.easeNone,onComplete:function(e,o,w,h){ RandomTween(e,o,w,h); },onCompleteParams:[e,o,w,h]}); } /** * Returns a random number between min and max */ function getRandomArbitary (min, max) { return random() * (max - min) + min; } var seed = 1; function random() { var x = Math.sin(seed++) * 10000; return x - Math.floor(x); } Am I missing something here?
×