Getting the color from an image
I started this project that I’ve wanted to work on for a little while. Basically I wanted to simplify the colors in an image down to one color that represents that image, trying the average color as well as the dominant color. I would then drew this color onto the current swatch just below the [...]
scrollwheel (on mac)
I haven’t added scrollwheel functionality to an as3 project yet, I did it the other day, the code looks like this: stage.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel); private function onMouseWheel(e:MouseEvent):void { trace(e.delta); } pretty basic, there’s a delta property that is a positive or negative int based on the direction you’re scrolling. The problem is it doesn’t work on [...]
Particles
this is a basic particle system. Particles get created, each with a unique size and speed. Added blend mode / blur. code: function drawDot(e:TimerEvent):void { var p:Dot = new Dot(); } //pick a random # between 50-100 var rw:Number = Math.random() * 50 + 50; var rh:Number = Math.random()*50+50; //draw a circle p.graphics.beginFill(0x3c3c81, .7) p.graphics.drawEllipse( [...]
GRID
the effect from the post below becomes much cooler when the effect is replicated. this is just a grid of the previous example. There are a couple ways to make a grid: One way is to work with the items as groups of rows/columns. This is probably how the Space Invaders enemies are set up. [...]
Distance + Rotation
Here”s something that”s not anything new, but showcases some classic flash functionality. this basically uses two functions, one to get the angle of the mouse > center of the arrow, and then one to get the distance from the mouse > center of the arrow. //get the distance between the two x and y positions [...]