Dynamic sliders numero 2

Title: Dynamic Sliders Numero 2
After working with the previous version of the sliders -se previous post-. I had the opportunity to “upgrade” the sliders since there was a slight chance that the sliders had to react to only one button rather than two as originally planned. Needless to say it wasn’t required to apply this [...]

Dynamic Sliders

So I was working on a project where we needed some sliders, it was basically the same slider but in different sizes and positions. So today I was sitting there just wondering how I could make this more dynamic, and just put a small class together and created a small sample. Updating the sliders the [...]

Actionscript count and trace the number or arguments passed to a function

ActionScript:

 
var totalArgs = arguments.length;
trace(”Number of Arguments passed = ” + totalArgs);
for (var i:Number = 0; i < totalArgs; i++) {
   trace (”Argument “+i + “: ” + arguments[i]);
}
 

Actionscript Round and keep decimals function

ActionScript:

function formatDecimals2 (num, digits) {
 
if (num < 0 ) {
num = 0;
}
 
if (digits <= 0) {
return Math.round(num);
}
 
var tenToPower = Math.pow(10, digits);
var cropped = String(Math.round(num * tenToPower) / tenToPower);
 
trace(”digits:” + digits + ” – ” + cropped);
 
}
 
formatDecimals2( 35435.234234, 2);
formatDecimals2( 35435.234234, 3);
formatDecimals2( 35435.234234, 4);