Articles Tagged "Code"

FullScreen OnMouseMove Bug

stinkbugHere’s an interesting fact: Going to FullScreen mode causes Flash to temporarily stop executing all onMouseMove events.

I’m sure if someone from Adobe was pressed hard enough they might be able to provide some convoluted ~logical~ reasons why going into full-screen mode stops all onMouseMove events but I’m not buying it. I wasted a few frustrating hours figuring this out and when I searched the web to confirm my suspicions I found no mention of this “feature” so I’m calling it what it is, a BUG.

Here, take a look at this ugly SWF (move your mouse around to draw a line whenever the OnMouseMove event is fired and then press the blue square to toggle fullScreen mode)
Read More

Flash Scripted Conic Angle Gradient

One of the quirkier aspects of Flash is its lack of a 'conic' gradient fill. The conic gradient has been a mainstay of drawing apps like CorelDraw and Photoshop (where it's called an "Angle Gradient") for ages but Flash still hasn't implemented this basic feature. Go ahead and check... it's not there.

NOTE: This tutorial uses some of the code and concepts from my previous Color Gradient and Circle Drawing tutorials so I highly recommend checking them out for a more in-depth explanation of the following code ...
Read More

Rotated Oval Tutorial

rotated oval

Making the transition from drawing circles to drawing ovals is pretty simple but when you need to go from drawing ovals to drawing rotated ovals, you might run into a few problems. This article documents some of the pitfalls I encountered and presents them as a learning experience. If you just want some solid code to draw rotated ovals or twisted ellipses, skip ahead to the end of the article and copy the last block of code. If you think you might gain from my experience then by all means… read on.
Read More

Hexadecimal Color Fading Array

A while ago I wrote a Hexadecimal Color Fading Tutorial explaining how to select a single color at any point on a gradient between two specified colors. In that tutorial there was a function which efficiently broke each of the 2 specified colors into their Red, Green and Blue components and then calculated a single new color at a specified point between them.

Here's what the code looks like: ...
Read More

How to Draw a Logarithmic Spiral

What is a Logarithmic spiral? A logarithmic spiral steps around center at an additive rate while stepping away from center at a multiplicative rate. Increasing the distance from center at a multiplicative rate causes the arm of a logarithmic spiral to increase in size as it gets further from center. To illustrate, take a look at this photo of a spiral staircase:

bottom-up view
Photo by: darijus

As you can see in the above photo, the number of steps
Read More

How to Draw a Spiral

This tutorial covers the basic concepts needed to draw a simple spiral with ActionScript. A “simple spiral” or an “Archimedean spiral” is created by moving ‘away from’ and ‘around‘ a central point at a constant additive rate. If that sounds a bit foreign to you, don’t worry it’s nothing new. If you’ve coiled a hose or rope on a flat surface, you have experience working with Archimedean spirals.

Archimedean Spiral
(Photo by Paul Needham)

The most notable characteristic of the simple spiral above is that each coil (a full rotation around center) will always increase the spiral’s radius by the same amount (the width of the rope).

Now that you understand what a simple spiral is, I’d like to jump ahead a bit and show you the final state of our code:
Read More

Code Highlighting and Formatting in WordPress

I tried a couple different code highlighting plugins for WordPress and decided to use the aptly named “CodeHighlighter” by Wongoo Lee which is essentially an implementation of the well established and tested GeSHi – Generic Syntax Highlighter. Installation follows the usual pattern: unzip, upload to your plugins directory, and activate the plugin from your Plugin Management screen in WordPress.

Once installed, adding highlighted code to your blog is as easy as
Read More

© Sean O'Shell 2007-2024