The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 6 of 6

Thread: bitmap smoothing

  1. #1

    bitmap smoothing


    this is my first time here so, hi to all!

    so, i'm having a problem with the smoothing bitmap property that's really getting my nerves. here's part of the code.

    function imgLoad() {
        var img:MovieClip=new empty();
        var imgRequest:URLRequest=new URLRequest(unescape(infoXml.firstChild.childNodes[actImg].childNodes[0].childNodes.toString()));
        var imgIn:MovieClip=new empty();
        var imgLoader:Loader=new Loader();
        var over:MovieClip=new hover();
        img.addEventListener(MouseEvent.CLICK,external,false, 0, true);
    function imgLoaded(event:Event) {
        var imagem:Bitmap=event.currentTarget.content as Bitmap;
        if (actImg<infoXml.firstChild.childNodes.length) {

    the thing is that my image isn't getting smoothed and i don't understand why
    i'm new to AS3 so, it's the first time i try to use the smoothing property here. before, with AS2, I used forceSmoothing to the _mc where the image was and it worked fine.
    as you can see, i'm trying to smooth the image several times so that i'm sure it stays "true" for the intire script( i googled in this subject and found something about this property, sometimes, turned to "false", when the some image properties were changed)

    so, if someone could help me i would very thankful

    (if someone could also tell me if my code is "AS3 good", it would be cool, since i'm learning it all by myself and i'm not sure if i'm doing everithing right)

    see ya and thank you all
    Last edited by _fenix_; February 6th, 2009 at 08:43 AM.

  2. #2
    pretty hard to read your code. parent.parent.parent...?

    this is the part you need:

    var bitmap = new BitmapData (	Math.round (_loader.content.width),
    										Math.round (_loader.content.height)
    		bitmap.draw ( _loader.content );
    		this.addChild ( new Bitmap (bitmap, PixelSnapping.AUTO, true) );
    Last edited by .ral:cr; February 6th, 2009 at 11:16 AM.

  3. #3
    thank you for your response

    unfortunately, it's still not doing it.
    i couldn't mix the code you wrote right with mine, but still, i made some tests and it still didn't work as i need it to work. the smoothing isn't working.

    about the parent.parent.parent
    i agree with you, i loose myself in it lots of times
    i will try to find a better way to do this kind of stuff next time

  4. #4
    the ideea is to get the loaded photo (in your code, imgLoader is _loader in mine), and to duplicate it with bitmap data.
    after the photo is loaded apply my code. you have too many movieclips, so be carefull where you attach it, and also remove the original photo.
    now you should be able to resize smoothly the photo.

  5. #5
    I usually just do it like this

    if ( is Bitmap) {
    				Bitmap( = true;//turn on smoothing
    			} else {

  6. #6

    thank you for the support
    forgive me for not replying for so long, but a have been working in other projets in the meantime...

    as far as i undestood the problem, it happened because i was resizing images from 511px of height to 99px, and maybe this was too much. i tested this using smaller images and it worked fine.

    so, my solution will be to send 2 images and not just 1 to the flash. this shouldn't be a problem because site will have a backoffice, so, the resizing will be made by php, and we will still have 1 original image.

    here's the temporary html site

    thank you once more
    see ya

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012