Solved

photo gallery image fuzzy

Posted on 2008-06-19
6
439 Views
Last Modified: 2013-11-11
I have a flash photo gallery that was created by someone else. The problem is that the thumbnails of the image is fuzzy. It can be viewed on www.pesllc.com/pictures.aspx . No matter what i change the picture to it is still fuzzy or to big. I think that there is something in the actionscript that makes the image bigger than what i have. (ie. the image is 37x37, but when it is a thumb it is big so it stretches and makes the image fuzzy). I just don't know where this is. There were notes that came with this but nothing on this. I have attached the entire actionscript because i have no idea where it is. If there is another place this can be please let me know.
function title_name()

{

    bigname_arr = new Array();

    bigname_arr[1] = ["Pipe Shop"];

    bigname_arr[2] = ["Pipe Shop"];

    bigname_arr[3] = ["Pipe Shop"];

    bigname_arr[4] = ["Pipe Shop"];

    bigname_arr[5] = ["Pipe Shop"];

    bigname_arr[6] = ["Pipe Shop"];

    bigname_arr[7] = ["Pipe Shop"];

    bigname_arr[8] = ["Pipe Shop"];

    bigname_arr[9] = ["Yard"];

    bigname_arr[10] = ["Yard Diagram"];

    bigname_arr[11] = ["Yard Diagram"];

    bigname_arr[12] = ["Office"];

     } // End of the function

function init()

{

	_global.number = thumbsNo;

    _global.col = 2; //number of columns

    _global.row = 4; //number of rows

    _global.total = 192; //number of images total

    _global.imgPerPage = _global.col * _global.row; //images per page

    _global.lastPage = int(_global.total / _global.imgPerPage); //number of pages

    moveX = 16; //Thumbs Position horizontal

    moveY = 90; //Thumbs position vertical

    thumbWidth = thumbHeight = 95; //Thumbs with apart

	outThumb._visible = false;

    screen.swapDepths(20000);

    screen._visible = false;

    screen._alpha = 0;

    screen._xscale = screen._yscale = 10;

	img_preloader._visible = false;

	baloon._visible = false;

    baloon.swapDepths(300000);

    thumbsNo = Math.floor(Math.random() * (total / 2));

    screen.dname.nameTxt = bigname_arr[thumbsNo][0]; // Thumbnail in array

    loadBigImage();

    spd_1 = 3.500000E-001;

    spd_2 = 5.500000E-001;

    spd_3 = 2.500000E-001;

    spd_4 = 2.500000E-001;

    randomX = 500;

    randomY = 0;

    total_num = thumbsNo + "/" + 191; //Number of images on top of page

    _global.currentPage = 0;

    _global.prevPage = 1;

    _root.removeThumb(_global.prevPage);

    _root.duplicateThumb(_global.currentPage);

} // End of the function

function init_btn()

{

    next_btn._alpha = 0;

    prev_btn._alpha = 0;

    prev_btn.swapDepths(30000);

    next_btn.swapDepths(30000);

    next_btn.onRelease = function ()

    {

        if (_global.currentPage < _global.lastPage - 1)

        {

            ++_global.prevPage;

            _root.removeThumb(_global.prevPage);

            ++_global.currentPage;

            duplicateThumb(_global.currentPage);

        } // end if

    };

    prev_btn.onRelease = function ()

    {

        if (_global.currentPage > 0)

        {

            --_global.prevPage;

            _root.removeThumb(_global.prevPage);

            --_global.currentPage;

            duplicateThumb(_global.currentPage);

        } // end if

    };

} // End of the function

function duplicateThumb(seq)

{

    var _loc4 = seq * _global.imgPerPage;

    for (var _loc6 = 1; _loc6 <= _global.row; ++_loc6)

    {

        for (var _loc5 = 1; _loc5 <= _global.col; ++_loc5)

        {

            if (_loc4 < _global.total)

            {

                ++_loc4;

                duplicateMovieClip("outThumb", "outThumb" + _loc4, _loc4 + 100);

                thMc = this["outThumb" + _loc4];

                loadThumbs(_loc4);

                thMc.bigBar._visible = false;

                thMc._x = moveX + (_loc5 - 1) * thumbWidth;

                thMc._y = moveY + (_loc6 - 1) * thumbHeight;

			} // end if

            thMc.onRollOver = function ()

            {

                baloon._visible = true;

                baloon.onEnterFrame = function ()

                {

                    this._x = this._x + 2.500000E-001 * (_root._xmouse - this._x);

                    this._y = this._y + 2.500000E-001 * (_root._ymouse - this._y);

                };

                baloon._alpha = 70;

                baloon.com_txt.autoSize = "left";

                baloon.com_txt.text = bigname_arr[this._name.substr(8, 9)][0];

                if (bigname_arr[this._name.substr(8, 9)][0] == undefined)

                {

                    baloon._visible = false;

                    delete this.onRelease;

                } // end if

                baloon.baloon_w._width = baloon.com_txt.textWidth + 25;

            };

            thMc.onRollOut = function ()

            {

                thumbsNo = this._name.substr(8, 9);

                baloon._visible = false;

                baloon.onEnterFrame = null;

            };

            thMc.onRelease = function ()

            {

                thumbsNo = this._name.substr(8, 9);

                screen._visible = 0;

                this.loadBar.gotoAndStop(2);

                screen.dname._visible = false;

                screen.dname.nameTxt = bigname_arr[thumbsNo][0];

                total_num = thumbsNo + "/" + 191; //Number of images on top of page

                if (bigname_arr[thumbsNo][0] !== undefined)

                {

                    loadBigImage();

                } // end if

            };

        } // end of for

    } // end of for

} // End of the function

function loadBigImage()

{

    var _loc2 = new MovieClipLoader();

    var _loc1 = new Object();

    _loc1.onLoadProgress = function (target, bytesLoaded, bytesTotal)

    {

        loadedBytes = bytesLoaded;

        totalBytes = bytesTotal;

    };

    _loc1.onLoadComplete = function (c, httpStatus)

    {

    };

    _loc1.onLoadInit = function (target)

    {

        loadImage();

        screen._visible = true;

    };

    _loc2.addListener(_loc1);

    _loc2.loadClip("Editor/assets/large/image" + thumbsNo + ".jpg", screen.inScr);

} // End of the function

function loadThumbs(k)

{

    var _loc4 = new MovieClipLoader();

    var _loc3 = new Object();

    _loc3.onLoadProgress = function (target, bytesLoaded, bytesTotal)

    {

        loadedBytes = bytesLoaded;

        totalBytes = bytesTotal;

        loadingPercent = Math.floor(loadedBytes / totalBytes * 100);

        img_preloader._visible = false;

        img_preloader.pre_txt = loadingPercent + "%";

    };

    _loc3.onLoadError = function (target_mc, errorCode, httpStatus)

    {

    };

    _loc3.onLoadComplete = function (target_mc, httpStatus)

    {

        target_mc._parent._parent.baloon._visible = false;

    };

    _loc3.onLoadInit = function (target_mc)

    {

    };

    _loc4.addListener(_loc3);

    containerMC = this["outThumb" + k];

    _loc4.loadClip("Editor/assets/small/image" + k + ".jpg", containerMC.inThumb);

} // End of the function

function loadImage()

{

    screen._xscale = 0;

    screen._yscale = 0;

    screen._x = background._x + randomX;

    screen._y = background._y + randomY;

    screen._alpha = 100;

    screen.outScr._width = screen.inScr._width + 33;

    screen.outScr._height = screen.inScr._height + 27;

    screen.onEnterFrame = function ()

    {

        screen._x = screen._x + spd_1 * (background._x - screen._x);

        screen._y = screen._y + spd_2 * (background._y - screen._y);

        this._xscale = this._xscale + spd_3 * (100 - this._xscale);

        this._yscale = this._yscale + spd_4 * (100 - this._yscale);

        this.onRollOver = function ()

        {

            screen.dname._visible = true;

            screen.dname.onEnterFrame = function ()

            {

                if (this._currentframe == this._totalframes)

                {

                    delete this.onEnterFrame;

                }

                else

                {

                    this.nextFrame();

                } // end else if

            };

        };

        this.onRollOut = function ()

        {

            screen.dname.onEnterFrame = function ()

            {

                if (this._currentframe == 1)

                {

                    delete this.onEnterFrame;

                }

                else

                {

                    this.prevFrame();

                } // end else if

            };

        };

    };

} // End of the function

function scaleStage()

{

    Stage.scaleMode = "noScale";

    Stage.addListener(stageListener);

} // End of the function

function removeThumb(seq)

{

    var _loc4 = seq * _global.imgPerPage;

    for (var _loc5 = 1; _loc5 <= _global.row; ++_loc5)

    {

        for (var _loc3 = 1; _loc3 <= _global.col; ++_loc3)

        {

            ++_loc4;

            this["outThumb" + _loc4].removeMovieClip();

        } // end of for

    } // end of for

} // End of the function

title_name();

init_btn();

init();

loadMovieClip();

loadImage();

scaleStage();

Open in new window

0
Comment
Question by:techpr0
  • 3
  • 3
6 Comments
 
LVL 11

Expert Comment

by:ugeb
ID: 21827646
Hi,

Did you try taking out lines 194 & 195?  

Personally, I think your thumbnails are the right size, but, yes, they are blurry.  I'd resample the larger image and make the thumbs a little bigger.
0
 

Author Comment

by:techpr0
ID: 21831096
If i take out these 2 lines nothing appears in the large picture area.
Also, I tried with bigger images but it shows up bigger than the thumb area so that wasn't an option
0
 
LVL 11

Expert Comment

by:ugeb
ID: 21832803
I think your image is being scaled, which is why it shows up larger than the thumb area when you use a bigger thumb image.  

It looks like you may have left out some code.  containerMC contains the thumbnail images, and it is probably being scaled, but there is only one area it's referenced  in your code (178 & 179).  I would try to find any place else that is referenced and probably scaled.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:techpr0
ID: 21832990
That's what i figured previously, but i've been having the hardest time finding out where. The only thing that i left out was the beginning picture array to shorten up the code, but i  can't be certain i didn't miss anything. I have zipped the file the flash file for you to view if you have time here  

http://www.pesllc.com/gallery1.zip

I'm not sure if I can add more than 500 points but I will gladly do so if possible. Thanks.
0
 
LVL 11

Accepted Solution

by:
ugeb earned 500 total points
ID: 21833222
Okay, I looked at your fla file.  ContainerMC is called outThumb.  Try scaling it smaller in the flash authoring tool, or adding the lines:

containerMC._xscale = 100;
containerMC._yscale = 100;

right after line 154.  You'll have to play around.  I would make the thumbnails twice the size, and change the above lines to 50 instead of 100.
0
 

Author Comment

by:techpr0
ID: 21834286
Thanks worked like a charm. I ended up with the following where you suggested

containerMC.inThumb._xscale = 53;
containerMC.inThumb._yscale = 53;
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
air/as3 : is there a way to simulate TouchEvents? 1 403
HTML 5 or Flash 7 479
How to display a webpage in a flash 10 355
Script to Delete registry entry based on Product name 6 155
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now