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);
Tagged with:
 

4 Responses to Dynamically resizing images using the UILoader component in Flash using ActionScript 3.0

  1. Anonymous says:

    after the jump my ass. where is the link?

  2. Peter deHaan says:

    Anonymous,

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

  3. Nawar says:

    It can NOT be the whole thing :X

  4. bahare says:

    when I use this code,
    The following error appears in Compiler errors panel:

    Definition fl.containers:UILoader could not be found.

    please help me!!!!!!!!:(

Leave a Reply

Your email address will not be published.

You may 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="" highlight="">

Spam Protection by WP-SpamFree