Dynamically resizing images using the UILoader component in Flash using ActionScript 3.0

by Peter deHaan on December 20, 2008

in UILoader

The following example shows how you can automatically resize a Flash ActionScript 3.0 UILoader container by setting the Boolean scaleContent property. A value of true indicates that the image is automatically scaled to the size of the UILoader instance; a value of false indicates that the loaded content is automatically scaled to its default size.

Full code after the jump.

// ActionScript 3.0
/* Requires:
 * - UILoader component in Flash library
 */
import fl.containers.UILoader;
 
var uiLoader:UILoader = new UILoader();
uiLoader.scaleContent = false;
uiLoader.source = "http://www.helpexamples.com/flash/images/image1.jpg";
uiLoader.move(10, 10);
addChild(uiLoader);

{ 2 comments… read them below or add one }

1 Anonymous 07.29.09 at 6:54 am

after the jump my ass. where is the link?

2 Peter deHaan 07.29.09 at 8:04 am

Anonymous,

That’s the post. The full code. The whole thing.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Previous post:

Next post: