Flash CS3: Images look jagged when rotating, scaling, etc…

Problem:

Bitmap images in Flash look like crap when animated to rotate or scale.

Solution:

Right-click on the image in the library, select Properties and check Allow Smoothing

Here’s a screenshot:

Flash CS3 Allow Smoothing for Bitmaps

Actionscript 3: Event.target returns children of movieclip

Problem:

You’ve added a listener to a movieclip, but the target returned is another movieclip or sprite within that movieclip.

Solution:

myMovieclip.mouseChildren = false;
Read more

If I were on Wheel of Fortune…

Ryan: I’d like to buy a vowel… a “B” please…

Pat Sajak: “B” isn’t a vowel.

Ryan: Oh really? Well why don’t you just go ahead and give that to me then Pat?

Resizing bitmap images with Actionscript 3.0

Hey, I just did a quick experiment with bitmaps in AS3. Nothing fancy, I just loaded in an external JPEG, resized it into 3 different sizes and then drew them to stage. I’m sure someone can use this. For now, everything is hard-coded and the code is right in the .FLA. Maybe I’ll try and make a nice class out of this, although I’m sure there’s already one out there. Anyway, check out the code or download the FLA.

var mediaLoader:Loader = new Loader();
var bmFullsize:Bitmap;
var bmHalfsize:Bitmap;
var bmThumbsize:Bitmap;
 
mediaLoader.load(new URLRequest("ostrich.jpg"));
mediaLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, resizeImages);
 
function resizeImages(e:Event):void
{
	bmFullsize = new Bitmap(e.target.content.bitmapData.clone());
	bmHalfsize = new Bitmap(e.target.content.bitmapData.clone());
	bmThumbsize = new Bitmap(e.target.content.bitmapData.clone());
	bmFullsize.width = 300;
	bmFullsize.height = 300;
	bmFullsize.smoothing = true;
	bmHalfsize.width = 150;
	bmHalfsize.height = 150;
	bmHalfsize.x = bmFullsize.width;
	bmHalfsize.smoothing = true;
	bmThumbsize.width = 75;
	bmThumbsize.height = 75;
	bmThumbsize.x = (bmFullsize.width + bmHalfsize.width);
	bmThumbsize.smoothing = true;
	showImages();
}
 
function showImages():void
{
	addChild(bmFullsize);
	addChild(bmHalfsize);
	addChild(bmThumbsize);
}