View Mode: Normal | Article List
interview of laolu (2007)
[ 2009-04-27 15:53:14 | Author: liuhuan ]
Flash Russia Bricks (as3)
[ 2009-04-23 14:16:21 | Author: liuhuan ]
Russia Bricks is a classic game everybody has played before. I tried to make one in as3.
Here i used a classic way to describe the bricks in array:...
Read More...
Here i used a classic way to describe the bricks in array:
Quote
var arr_brickTypes:Array = new Array()
arr_brickTypes.push([[1,1,1,1]])
arr_brickTypes.push([[1,0,0,0],[1,1,1,1]])
arr_brickTypes.push([[0,0,0,1],[1,1,1,1]])
arr_brickTypes.push([[1,1,0],[0,1,1]])
arr_brickTypes.push([[1,1,1,1]])
arr_brickTypes.push([[1,0,0,0],[1,1,1,1]])
arr_brickTypes.push([[0,0,0,1],[1,1,1,1]])
arr_brickTypes.push([[1,1,0],[0,1,1]])
Read More...
Flash calendar (as3)
[ 2009-04-07 19:00:36 | Author: liuhuan ]
It's easy to use calendar in older flash version, since there is a Calendar component which is powerful and convinient.
For Flash CS3 and later versions, flash does not provide calendar component anymore. I don't know why. However, i made one myself.
The essential functions used in flash calendar are:
1. judge whether the year is olympic ...
Read More...
For Flash CS3 and later versions, flash does not provide calendar component anymore. I don't know why. However, i made one myself.
The essential functions used in flash calendar are:
1. judge whether the year is olympic ...
Read More...
online FavIcon creator
[ 2009-04-02 21:55:35 | Author: liuhuan ]
Open local txt file in flash (as3)
[ 2009-03-22 22:33:44 | Author: liuhuan ]
It might be impossible to open local file directly until Flash player 10's release. The "load" method of FileReference class provides us a way to open local file in bytearray.
There are several ways to open txt file, depending on the encoding type. If you are opening a file with utf-8 encoding, you could use:
Read More...
There are several ways to open txt file, depending on the encoding type. If you are opening a file with utf-8 encoding, you could use:
fileReference.data.readUTFBytes(fileReference.data.length)
...Read More...
Average color
[ 2009-03-21 14:58:45 | Author: liuhuan ]
A way to caculate average color for a image. I wasted a lot of time trying to open local image file into flash. This new function is only supported by flash player 10, using Bytearray which is convinient and powerful.
Read More...
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.geom.Rectangle;
import fl.controls.Button;
...import flash.display.BitmapData;
import flash.geom.Rectangle;
import fl.controls.Button;
Read More...
Bresenham algorithm
[ 2009-03-20 22:29:33 | Author: liuhuan ]
Bresenham algorithm is widly used in drawing straight lines. More importantly, it provides a way for us to find the shortest way from one point to another when developing flash games.
If you want to draw a tiny thin line in flash, have a try with this algorithm.
Read More...
If you want to draw a tiny thin line in flash, have a try with this algorithm.
var size:Number = 20;
var curPoint:int = 1;
var firstPoint:Point= new Point();
...var curPoint:int = 1;
var firstPoint:Point= new Point();
Read More...