road0001 / tweensy

Automatically exported from code.google.com/p/tweensy
1 stars 0 forks source link

tweensygroup, brightnessTo: time can not be 0 #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
sometmes i need to set brightness immediately back to default (= 0)

## What steps will reproduce the problem?

try this:

var _tg:TweensyGroup = new TweensyGroup();
_tg.brightnessTo(MYOBJECT, 0, 0, null, 0);

## What is the expected output? What do you see instead?

> MYOBJECT disappears, after function has been started

## What version of the product are you using? On what operating system?

flash cs5/ os: win7, build7600.x

## Please provide any additional information below.

none

Original issue reported on code.google.com by holzst...@googlemail.com on 3 Mar 2011 at 8:41

GoogleCodeExporter commented 8 years ago
That's because the ease functions return NaN, due to division by Zero.
You can either set the duration in your call to a very small value (e.g. 0.001) 
or you can modify TweensyTimeline.as:

Replace the two occurrences of:
var position : Number = ease.apply(null, args);
by:
var position : Number = _duration!=0 ? ease.apply(null, args) : 1;

Original comment by Christop...@gmail.com on 20 Oct 2011 at 11:34