Clipping values to stay between 0 and 1


/ Published in: ActionScript 3
Save to your folder(s)

This can be used for equations, volume, movement etc


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.