A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Scaling Externally Loaded Images

  1. #1
    Junior Member
    Join Date
    Sep 2006
    Posts
    23

    Scaling Externally Loaded Images

    I have a container clip that loads an external jpeg. At the root, the size of the container is 200 x 200, which enlarges to 400 x 400 (a rollover thumbnail that enlarges to preview)
    In Photoshop I've designed my image for at 400 X 400 as I'd like it to look its best when enlarged. However, when it loads into the container at runtime, it exceeds the container and loads at full size 400x400.

    When I save for web at 200 x 200, it fits perfectly when loaded into the container, then loses its resolution when enlarged to 400x400.

    Is there an optimal format I should be using, or an actionscript command to have the 400X400 image load into a 200X200 container and conform to the small size?

  2. #2
    Member
    Join Date
    Jan 2008
    Posts
    58
    To see the MovieClipLoader Class. In this class there is events like onLoadInit and onLoadComplete u can do use this events.

  3. #3
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    like mentioned using a movieClipLoader() instance will let you re-size (scale) down to your desired sized using the onLoadInit() callback...


    (onLoadComplete is sort of buggy..using init is better as you can actually manipulate the image then)


    also, you can do use attachBitMap() as well to copy the loaded image and scale it without pixelation..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center