Monthly Archives: September 2008
Soundcard check
To check if the soundcard is available, test if the SoundChannel class is not null var sound:Sound = new Sound(); var channel:SoundChannel = sound.play(); if(channel != null){ trace("Soundcard available"); }else{ trace("Soundcard not available"); }
numberLoop
Here is a method that I use a lot when I need to loop a length of any kind trace(numberLoop(103754, 3)); //2 trace(numberLoop(686.9384, 17.53)); //3.268399999999957 trace(numberLoop(Math.PI*13/6, Math.PI*2)); //0.5235987755982991 rad – radToDegree == 0.5235987755982991*180/Math.PI -> 30.000000000000014º trace(numberLoop(-2187.4, 2)); … Continue reading