Posted By

sidneydekoning on 06/18/10


Tagged

values clipping


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

socialflasher


Clipping values to stay between 0 and 1


 / Published in: ActionScript 3
 

This can be used for equations, volume, movement etc

  1. // clipping values for volume
  2. function set volume( value:Number ):void {
  3. _soundTransform.volume = Math.min(Math.max(value, 0), 1);
  4. }

Report this snippet  

You need to login to post a comment.