19Aug

APE Vectors and Collidable Walls

No comments

So I just added some walls to my little movie here and took out the KEY_UP handler to allow the circle to continuously move around the stage. To activate, simply hit an arrow key.

package {
import flash.display.Sprite;
import flash.events.Event;
import org.cove.ape.APEngine;
import org.cove.ape.Vector;
import org.cove.ape.CircleParticle;
import org.cove.ape.Group;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import flash.text.TextField;

public class Main extends Sprite
{
private var cp:Circle = new [...]

03Jul

Fireworks and On Vacation

No comments

“See” you all late next week - Have a good holiday! I modified some code from Keith Peter’s book to create the animation, you can check out his book here: Foundation Actionscript 3.0 Animation: Making Things Move!, to create this fireworks animation display.

a2a_linkname=”Fireworks [...]

Categories: manewc.com
30Jun

Filling BitmapData Colors with an alternate color with the floodFill Method

No comments

I wanted to learn more about bitmap data in flash and came across the floodFill() method. It basically will replace a color with one you assign it. In the demo the original color is a light blue (rgb 003366) and when you click the stage the square will change colors via the floodFill method.
[kml_flashembed movie="/projects/flash/FloodFill/FloodFillExample.swf" [...]

Categories: manewc.com
04Jun

Combining Arrays with the Array.Concat Method

No comments

The Actionscript Document Class:

package
{
import flash.display.Sprite;
import fl.controls.TextArea;
import fl.controls.ScrollPolicy;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFieldType;
import flash.text.TextFormat;

public class ArrayConcat extends Sprite
{
private var output:TextArea;
private var ArrOne:Array;
private var ArrTwo:Array;
private var ConcatArrays:Array;

public function ArrayConcat()
{
init()
}

private function init():void
{
// display our output field
Output();

// set up the arrays
ArrOne = new Array(1, 2, 3);
ArrTwo = new Array(4, 5, 6);
ConcatArrays = ArrOne.concat(ArrTwo);

// display the output
msg ( [...]

16May

Preloading Multiple Images with Actionscript

2 comments so far

One of my new projects involves a lot of imagery so I decided to write a class that I could send it an array of images and preload them with a loading bar. The code below doesn’t have a loading bar, but if you trace out the code you can see how you can integrate [...]