Articles Tagged "SWFs"

Tantalizing Tendril

Similar to my previous Candy Cosmos post, this ActionScript Flash experiment/art/eye-gouge isn’t interactive but it’s pretty fun to watch.

Update: You can see a gallery of images created with Flash ActionScript code similar to that used in the above example. Be sure to check out the Tantalizing Tendril Image Gallery.

Improving the Limit Function

As a continuation of a previous post “How to Limit a Number Between Two Values” I thought I’d make my “limiting” code a little more versatile.

The previous post used the following code to ‘limit’ or ‘constrain’ a number between a low and high value:

//
// Limit a number between two values.
function limit (num, lo, hi){
    if (num < lo) return lo;
    if (num > hi) return hi;
    return num;
}
//

But what if you don’t want to, or can’t, control the order of the “lo” and “hi” arguments?
Read More

How to Limit a Number Between 2 Values

Limiting or constraining a number to a specified range of values isn’t the most common task you’ll have to perform in Flash, but it does pop up from time to time. If you encounter such a situation here is a little bit of code for your consideration:
Read More

Random Candy Colors

If you saw my recent “Candy Cosmos” post, you may have noticed that the randomly generated colors tend to be rather “vibrant”.

rainbbowgradient.jpg

Pure red, green, blue, cyan, magenta and yellow colors appear frequently, while pure black and white colors occur occasionally, and colors near 50% gray tend to be the least common. The bright candy colors are a side effect caused by
Read More

Hexadecimal Color Fading

A while ago, I wrote a Color Fading tutorial for ActionScript.org which provided nearly all the functions you’d ever want for fading colors. Did you notice that I said “nearly”? Well, today I’ve added yet another weapon to my color-fading code arsenal called “fadeHex”. The name probably won’t put fear in the hearts of fellow code warriors but it’s a powerful tool none the less. In essence, it lets you specify two colors, then creates a color gradient from the first color to the second and lets you choose a color at any point on that gradient.
Read More

Candy Cosmos

Watch it go or “click and drag” to interact. Press any key to change the color.

© Sean O'Shell 2007-2024