Stay Connected

Get Your Site Submitted for Free in the World's Largest B2B Directory!

Email Address:
* URL:
*
*Indicates Mandatory Field

Terms & Conditions

Navigation

Home

About

Tutorials

Featured Sites

Newsletter

FLADownloads

Forum

Jayde

iEntry

Advertise

Contact Us







ImageLoader Class For Flash 8

By Martijn de Visser
Expert Author
Article Date: 2006-10-16

This piece of code has been lying around for some time. I wrote it due to the fact that Flash 8 doesn't smooth dynamically loaded images by default.

This means that scaling and rotating any dynamically loaded image will make it look "jagged".

The first (for as far as I know) to write Flash code to circumvent this issue was Master Tinic Uro himself; he is one of the engineers at Adobe working on the Flash Player. He wrote a handy function to load an image dynamically and then smooth it using a neat BitmapData / MovieClip trick

I wrapped his idea and some extras (events from MovieClipLoader class are relayed and the PNG transpareny solution is also included) in a single class I dubbed ImageLoader (duh).

Usage is as follows:
var loader:ImageLoader = new ImageLoader();
loader.addListener(this);
loader.loadImage( "some_image.jpg", some_mc );
In the sample above, the ‘this' context will receive all events normally fired by the MovieClipLoader class while loading an image.



Tag: ,

Add to Del.icio.us | Digg | Yahoo! My Web | Furl

Bookmark WebProNews:

About the Author:
Martijn de Visser focuses on User Experience Design at Lost Boys in Amsterdam. There he works on media-rich online campaigns, Rich Internet Applications and desktop tools for clients such as KLM, Heineken, Nuon, Volkswagen and Hi. He maintains a blog at www.martijndevisser.com and works on various projects such as FLV Player and Screenweaver Open Source.



 
 
Newsletter Archive | Article Archive | Submit Article | Advertising Information | About Us | Contact | Site Map

FlashNewz is an iEntry.com publication
© 1998-2008 iEntry Inc. All Rights Reserved Privacy Policy Legal