Browsing the tag code

In the project I am currently working on I got textfields that scrolled when I used the mouse wheel. To avoid this you simple disable the mouse for the textfield.

textfield.mouseEnabled = false;

Post to Twitter

Tagged with , , , ,

Create your own custom easing equation:
http://blog.greensock.com/customease/

Custom Ease Builder

Post to Twitter

Tagged with , , ,

Since upgrading to Snow Leopard (Mac OS X 10.6) on my Mac I have had some problems with Flex Builder. The most irritating problem is that the right (and left) column that highlights class errors are not updating correctly.

Screen-shot-2009-09-18-at-11.09.52

I realised that this only happens if I use Flexbuilder on my external monitor. However … if I resize the window of Flex Builder it updates correctly. Really strange.

Solutions?

Post to Twitter

Tagged with ,

Every time you change the bitmapData source for a Bitmap you also need to set the smoothing property on your Bitmap to true (if you want the bitmap to use smoothing).

var bitmap : Bitmap = new Bitmap();
bitmap.smoothing = true;
trace(bitmap.smoothing); // true
bitmap.bitmapData = new BitmapData(320, 240);
trace(bitmap.smoothing); // false

Post to Twitter

Tagged with , , , ,

Commas or spaces can be used to make reading numbers a little easier. They are placed every 3 decimal places for numbers comprising 4 digits or more. I wrote a AS3 method that returns the nicer format.

$1000000
$1 000 000

public static function separateByThousand(valueNumber : Number, splitter : String = " ") : String
{
	var valueString : String = "";
	var valueLength : Number = valueNumber.toString().length;
 
	for (var i : int = 0; i < valueLength ; i++)
	{
		if ((valueLength-i)%3 == 0 && i != 0)
			valueString += splitter;
		valueString += valueNumber.toString().charAt(i);
	}
 
	return valueString;
}

separateByThousand(1000) //1 000
separateByThousand(100000) //100 000
separateByThousand(1000000) //1 000 000
separateByThousand(1000000,”,”) //1,000,000

Post to Twitter

Tagged with , ,