7 Replies Latest reply on Apr 13, 2010 6:23 PM by kglad

    Dynamically Loaded JPEGs are Jagged

    Happy Camper Level 1

      I have a file that dynamically loads JPEGs in two sizes (thumbnails and zoom). There is nothing in the AS concerning sizing, only loading and positioning.

       

      The site looked fine and now the pictures all have jagged edges to them (it's stained glass and the leading looks edgy instead of smooth).  The photos that are loading look smooth upon uploading.  I have them Publishing as, Flash Player 8, AS 2.0, JPEG Quality at 100, only Protect from Import is checked, I'm working in Flash CS4 on a Mac.

       

      Here is the site:

      http://www.naomisartglass.com/gallery.html

       

      Any ideas?  I'm out of ideas, the client's freakin' out.... Thanks!

        • 1. Re: Dynamically Loaded JPEGs are Jagged
          kglad Adobe Community Professional & MVP

          enable forceSmoothing to the your target movieclip AFTER loading is complete.

          1 person found this helpful
          • 2. Re: Dynamically Loaded JPEGs are Jagged
            Happy Camper Level 1

            kglad, thanks for the information, however, it's not working, cleared my cache, still there.  Any other ideas?

            • 3. Re: Dynamically Loaded JPEGs are Jagged
              kglad Adobe Community Professional & MVP

              show your code that uses forceSmoothing and loads your image(s).


              • 4. Re: Dynamically Loaded JPEGs are Jagged
                Happy Camper Level 1

                varReceiver = new LoadVars();
                //change text file loading
                varReceiver.load("hanging.txt");
                varReceiver.onLoad = function() {
                    _root.numOfPics = Number(varReceiver.numOfPics);
                    trace(_root.numOfPics);
                    var originalX = new Array(_root.numOfPics+1);
                    var originalY = new Array(_root.numOfPics+1);
                    for (i=1; i<=_root.numOfPics; i++) {
                        //change path to photos
                        _root["pic"+i].loadMovie("images/gallerySm/"+i+".jpg");
                        _root["picT"+i] = varReceiver["picT"+i];
                        originalX[i] = _root["pic"+i]._x;
                        originalY[i] = _root["pic"+i]._y;
                        _root["pic"+i].forceSmoothing = true;
                    }
                    _root.onEnterFrame = function() {
                        for (j=1; j<=_root.numOfPics; j++) {
                            if (_root["pic"+j].getBytesTotal() && _root["pic"+j].getBytesLoaded() == _root["pic"+j].getBytesTotal()) {
                                _root["pic"+j]._x = originalX[j]+(150-_root["pic"+j]._width)/2;
                                _root["pic"+j]._y = originalY[j]+(150-_root["pic"+j]._height)/2;
                            }
                        }
                    }
                };

                 

                 

                 


                _root.bigPicText._visible = false;
                _root.bigPic._visible = false;
                _root.blackFade._visible = false;

                 

                var bigPicYPosition = [3, 146, 289, 432, 575, 718, 861, 998, 1050];

                 

                fadePicUp = function () {
                    _root.bigPic._alpha += 5;
                    if (_root.bigPic._alpha>=100) {
                        clearInterval(timeToFadeUp);
                    }
                };

                 

                fadeBlackUp = function () {
                    _root.blackFade._alpha += 5;
                    if (_root.blackFade._alpha>=100) {
                        _root.blackFade.onPress = function() {
                            _root.timeToFadeDown = setInterval(_root.fadePicDown, 50);
                            _root.timeToFadeBlackOut = setInterval(_root.fadeBlackDown, 50);
                            _root.clickOff_mc._visible = false;
                            _root.bigPicText._visible = false;
                            delete _root.blackFade.onPress;
                        };
                        clearInterval(timeToFadeBlack);
                    }
                };

                 

                loadTheBigPic = function () {
                    delete onEnterFrame;
                    clearInterval(timeToFadeUp);
                    clearInterval(timeToFadeBlack);
                    clearInterval(timeToFadeDown);
                    clearInterval(timeToFadeBlackOut);
                    var yPosition = _root.bigPicYPosition[Math.floor((_root.picNum-1)/4)]+100;
                    _root.bigPic._visible = true;
                    _root.blackFade._visible = true;
                    _root.bigPic._alpha = 0;
                    _root.blackFade._alpha = 0;
                    timeToFadeBlack = setInterval(_root.fadeBlackUp, 50);
                    //change the path to the photos
                    _root.bigPic.loadMovie("images/galleryLg/"+_root.picNum+".jpg");
                    _root.bigPic._x = 20;
                    _root.bigPic._y = yPosition;
                    _root.bigPic.forceSmoothing = true;
                    _root.onEnterFrame = function() {
                        if (_root.bigPic.getBytesTotal() && _root.bigPic.getBytesLoaded() == _root.bigPic.getBytesTotal()) {
                            _root.bigPic._visible = true;
                            _root.clickOff_mc._visible = true;
                            timeToFadeUp = setInterval(_root.fadePicUp, 50);
                            _root.clickOff_mc._x = 20;
                            _root.clickOff_mc._y = _root.bigPic._height+bigPic._y+20;
                            delete onEnterFrame;
                        }
                    };
                    _root.bigPicText.htmlText = _root["picT"+_root.picNum];
                    _root.bigPicText._y = yPosition - 100;
                    _root.bigPicText._visible = true;
                };

                 

                fadePicDown = function () {
                    _root.bigPic._alpha -= 5;
                    if (_root.bigPic._alpha<=0) {
                        clearInterval(timeToFadeDown);
                    }
                };

                 

                fadeBlackDown = function () {
                    _root.blackFade._alpha -= 5;
                    if (_root.blackFade._alpha<=0) {
                        clearInterval(timeToFadeBlackOut);
                        _root.blackFade._visible = false;
                    }
                };

                 

                 

                 


                _root.pic1HS.onRollOver = function() {
                    this.gotoAndStop(2);
                };
                _root.pic1HS.onRollOut = function() {
                    this.gotoAndStop(1);
                };
                _root.pic1HS.onPress = function() {
                    _root.picNum = 1;
                    _root.loadTheBigPic();
                    this.gotoAndStop(1);
                };

                 

                Etc........

                • 5. Re: Dynamically Loaded JPEGs are Jagged
                  kglad Adobe Community Professional & MVP

                  again: enable forceSmoothing to the your target movieclip AFTER loading is  complete.

                  • 6. Re: Dynamically Loaded JPEGs are Jagged
                    Happy Camper Level 1

                    where would you put it?  I thought that putting it there, after it loaded, but within the "for" loop was right.  It has to smooth each photo, so it needs to be inside of the "for" statement... again thanks for the help!

                    • 7. Re: Dynamically Loaded JPEGs are Jagged
                      kglad Adobe Community Professional & MVP

                      that's after it STARTS loading.  that code needs to execute after the image(s) COMPLETE loading.  ie, use preloader code or the onLoadInit() method of the moviecliploader listener.