Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Problem With LOADING And RESIZING Images



ok, the code I have is the following:

Code:
_root.my_MC.createEmptyMovieClip ("pic1holder", 2);
_root.my_MC.pic1holder.loadMove("http://www.mypage.com/someJPEG.jpg");
_root.my_MC.pic1holder.onLoad = function () {
//some code to resize the image depending on its current size
}
however, after checking the help section, it seems that onLoad is only available for LoadVars objects...
now, my code works fine SOMETIMES, and on SOME pictures, but sometimes the pictures are NOT resized...which leads me to believe that perhaps the image is only resized if it is being loaded FAST enough, since the code "pic1holder.onLoad = function ()" is being executed even if the image is NOT laoded.
so, my basic question is, how can I check if the image has been loaded, and THEN resize it accordingly?

any help is appreciated..
regards
I. Jamal



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-10-2006, 07:12 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

XML, Loading Images, Resizing Etc.
I'm trying to make an image gallery for a website I'm doing where I send through a variable to the Flash file which tells it what images to load.

I have a few problems. I have my images in an Xml file like so:


HTML Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<images>
<photo url="blah1.jpg" caption="1"/>
<photo url="blah2.jpg" caption="2"/>
<photo url="blah3.jpg" caption="3"/>
<photo url="blah4.jpg" caption="4"/>
<photo url="blah5.jpg" caption="5"/>
<photo url="blah6.jpg" caption="6"/>
</images>
Then I load them into an Array in flash. This works ok. My problems are:
1. Can I send an array from HTML to flash? I've tried <embed blah blah "blah.swf?imgArray=[1,2,3] etc. but that doesn't work. I need to send a variable to flash so the flash knows which images to load into the gallery.

2. Resizing and Positioning loaded image.

I load the image in and the top left corner appears in the center. I've searched to forums and NONE of the answers I found work or were extremely poor answers. I need to load the image into an MC (inside another MC if required) and position it dead center, scale the width to the size I want and scale the height accordingly (the images are all different sizes, something I'm not going to change).

How can I solve these two problems?

Loading And Resizing Images - Works, But Not 1st Time...
HI guys, im using this to load images into a movieclip, then resize them:


Code:

loadMovie"picture.jpg", _root.holder);
_root.makeSmall(_root.holder, 192, 173, 0);

function makeSmall(theImg, maxWidth, maxHeight, num) {
if (num) {
// stop interval
clearInterval(num);
}
// resize the image if it's too big
with (theImg) {
if ((_width>maxWidth) || (_height>maxHeight)) {
ratWidth = maxWidth/_width;
ratHeight = maxHeight/_height;
if (ratWidth<ratHeight) {
_height = _height*ratWidth;
_width = _width*ratWidth;
} else {
_height = _height*ratHeight;
_width = _width*ratHeight;
}
}
}
}
-- This works fine. After being called for a 2nd time. If i run the code, the image will load, but not resize. If i run it again, it resizes.

The image being loaded is random each time - and it resizes everytime after being the 1st load not working.

And advice? or any better function to load then resize an image in a movieclip.

Regards

Disfigure Images By External Loading And Resizing
hi
i have a loader component that loads external images. it resizes images if it should be. but it disfigures the images specially the lines in it by making slices of disconnected lines !!!. is the problem from loader component (i don't think so) or it's a problem of flash player !

is there any solution??

Resizing Mc And Images
Hi

I am trying to resize some movie clips and images to give the effect that they are inside a screen (ie computer or tv) so that the left hand edge is longer than the right hand edge (slopping away)

Is there anyway I can do this in flash?

I can edit images in Fireworks to successfully get the required effect, but didnt want to have to do for every graphic of the movie clips. Ive tried using the freeform tool, as in Fireworks, but dont get the same effect.

Is this possible?.....Im using Flash MX

Thanks in advanced

andybrad

Resizing Images
i have learnt from the forum that to resize the stage...
this._xscale = 160;
this._yscale = 160;

but if i juz want to resize an image says imgA
what should the properties be?

i try
imgA._xscale = 160;

and it didnt work

please advise...

Resizing Images Help
I have a box and in it is some dynamic text. This text is changed depending on the menu item you clicked. Is there a simple way to get the box resized to closely fit the text or will i just have to pass the wanted box's x and y values along with the text. thanks in advance

Resizing Images
are there any progam that will let me allow me to change the resolution on a lot of picutes all at one time

Resizing Images
can anyone tell me how i can create a flash files that has a browse button with which icna select a JPEG/BMP/GIF picture and then save the thumbnail and the imae onto a particular folder on the sever.

[F8] Resizing Images In An Mc
hello, ive been using some code to import images from an xml file to create a photo gallery. However i want flash to resize the images if they are too big/small. At the moment i have only been succesful with giving a certain scale to abide by, but of course the larger images need scaling down more etc. So does anyone know of a way to make flash scale the images for me so i can keep updating the gallery and only have to add to the xml file?

Here's the code i have been using:


Code:
function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {

image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;

}
firstImage();

} else {

content = "file not loaded!";

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("xml test.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {

if (Key.getCode() == Key.LEFT) {

prevImage();

} else if (Key.getCode() == Key.RIGHT) {

nextImage();

}

};
Key.addListener(listen);
previous_btn.onRelease = function() {

prevImage();

};
next_btn.onRelease = function() {

nextImage();

};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {

filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {

preloader.preload_bar._xscale = 100*loaded/filesize;

} else {

preloader._visible = false;
if (picture._alpha<100) {

picture._alpha += 10;

}

}

};
function nextImage() {

if (p<(total-1)) {

p++;
if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}

}
function prevImage() {

if (p>0) {

p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}
function firstImage() {

if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}

}
function picture_num() {

current_pos = p+1;
pos_txt.text = current_pos+" / "+total;

}
cheers.

Resizing Images
I am loading multiple images of various widths and heights from a website into flash. I would like to have these images resized and displayed as equal widths (or heights, depending on which is greater). For example, a picture is loaded that is 162x92 and I would like it scaled so that the height is on 100 and that the image stays in proportion. This all has to be done during run time, how can I acheive this? Any help would be greatly appreciated.

Resizing Of Images
hi, im doing resizing of images in the scrolling marquee using actionscript. can anyone help me by giving me the codes for the resizing?

Resizing Images
Hi

How can i resize a dynamically loaded image in flash?









Attach Code

this.createEmptyMovieClip("new_mc", this.getNextHighestDepth());
this.new_mc.loadMovie("testimage.jpg");

Resizing The Images
hi,
i want to resize and centering external images.

i have done with centering the images.

but how to do resizing.....here is my code....

// code for centering images starts

//Define center coordinates
var centerX:Number = _root.emptymc_mc.imagemc_mc._width / 2;
var centerY:Number = _root.emptymc_mc.imagemc_mc._height / 2;

var movieClipLoader:MovieClipLoader = new MovieClipLoader();
var loaderListener:Object = new Object();

//Use the onLoadInit function to get the loaded images proportions
loaderListener.onLoadInit = function(target:MovieClip) {

trace(target._width + " x " + target._height)

target._parent._x = centerX - target._width / 2;
target._parent._y = centerY - target._height / 2;
}
// end resizing and centerring code

// now loading images into movie clip loader

movieClipLoader.addListener(loaderListener);
var movieClipHolder:MovieClip = _root.emptymc_mc.imagemc_mc.createEmptyMovieClip(" container", getNextHighestDepth());

var movieClipLoaderTarget:MovieClip = movieClipHolder.createEmptyMovieClip("loader", 1);

//Load an image to the target
movieClipLoader.loadClip(_parent._parent.thumbs.fi rstChild.childNodes[2].childNodes.childNodes[0].nodeValue, movieClipLoaderTarget);

// end


now how to resize the images???

Resizing Images - PLEASE HELP
Hi, I am having issues getting an imagine to resize. I used the Kirupa XML photogallery tutorial, which works fine, but want the images to resize to fit in the square space I have on my site. I am loading images into a movie clip holder, and that all works fine, but I want to get the images to automatically resize, so they are constrained by both a max width and height, but stay proportional. So, if the max was 300 in both directions, a landscape shot would display with a width of 300 and a proportional height, and a portrait shot would be height of 300 and whatever the corresponding width was. The code I have in the movie clip now is below. It sort of works, but not all the time and something is a little off with the calculations. I've spent an embarassing amount of time on this but I am missing something. Also note I don't want the images to change if they are smaller than the space, bc right now flash expands them. Thanks SO SO much for your help.

onClipEvent (load) {
if (this._width>this._height) {
w_target = 320/this._width;
setProperty("", _width, this._width*w_target);
setProperty("", _height, this._height*w_target);

} else {
h_target = 260/this._height;
setProperty("", _height, _height*h_target);
setProperty("", _width, this._width*h_target);
}}

PS - does anyone know a way to make the picture and/or movie clip holding it display centered?

PPS - I have also tried this....

onClipEvent (load) {
if (this._width>this.height && this._width>300) {
percentage = 320/this._width;
setProperty("", _width, this._width*percentage);
setProperty("", _height, this._height*percentage);

} else if (this._height>this.width && this.height>200) {
percentage = 240/this._height;
setProperty("", _height,_height*percentage);
setProperty("", _width, this._width*percentage);
} }

Resizing Images
I'm using this actionscript to load a jpeg from a MySql database


ActionScript Code:
_root.detailfade.detail2.photoContainer.loadMovie(myLv["pic"+(numb)]);


All images loaded are in landscape proportions. I would like to resize the images that are loaded to a set height (the photo might have to be either enlarged or reduced) but maintain the proportions of the picture (i.e the resize the width to keep proportions)

Any help would be great. Thanks.

Help Resizing Images
Hi Guys

I have just finsihed testing the Kirupa tutorial on creating a photogallery in Flash using XML to access the content.

I have changed the XML file to use my own pics and it works sort of ok ... but
the pictures are 'cropped' by his code to fit the application.

Has anybody managed to resize their pics maintaining aspect ration and able to share the code please, thanks

george

Resizing Images.
I have hundreds of pictures, and planning on creating a photography portfolio.
I created a movie clip to be a thumbnail of my photo (size: 100x100) and use AS to load the JPEG into the it, and then with AS, I made the thumbnail expands to 600x600 when it is clicked, but the images did not do the same.

Is there a way to load a 600x600 JEPG into a 100x100 movie clip and then resize as the movie clip does?

Thanks a lot

Resizing Images
How can I get a jpeg that loads with the loadmovie command to fit to the dimensions of a movieclip that is being used as its "place holder"?

Also if this image starts off initially at a much larger resolution than the place holder movieclip and therefore has to be shrunk down to start with, what happens when browser window is then resized to a larger window? (i.e the whole flash movie is enlarged). Will the image be stretched from the size it has been shrunk down to or will it still reference that external file? So if the image was larger than the site would ever need it to be would it look the best quality at all times?

Does this make sense? I posted before about this but I don't think I was clear on what I was trying to do!

Resizing Images After Using XML
I guys again,

I was wondering if it was possible to resize the images in flash.

I had a gallery of 100 pictures and i dynamicly loaded them into flash, but the only problem was that they were way to big. and for some reason flash does a 1pixel to 1pixel ratio between picture and stage you could only see half the picture

i was wondering if it was possible to scale the dynamic pictures.

note:im just using flash and xml right now

Resizing Images On Rollover
Hey,
I have some pictures on the site that I am making, and I would like them to remain as thumbnails, but when the mouse rollsover one I want it to blow up to normal size. Then when it rollsout I want it to go back to the thumbnail size. I made a MC of the picture enlarging, and it work on rollover, but I can't figure out how to get it to go back to being a thumbnail when you roll the mouse out. (It can just jump back to the thumbnail, no need for another MC...yet.) But if using 2 MC's is easiest thats fine.
Thanks!
Josh

Dynamic Resizing Images
I was wondering if somebody could help me out.
Somebody posted the file below. Everything is working but I can't seem to figure out how to load more than one image when I click a button. (similar to Sample


You can find the sample here: http://members.shaw.ca/jpetrahn/

If somebody could modify the file and repost it I would really appreciate it.

Thanks

Images Distort When Resizing Swf?
Hi folks.

I've wrote a javascript function which resizes the embedded *.swf based upon the users' screen resolution.

Most of the swf content resizes perfectly. However, some of the images appear to be 'wobbly' and distorted.

Can anyone tell me why this is happening and how I can get rid of this??

Thanks in advance.

Resizing Images Dynamically?
I want to resize an image dynamically,

I know that this._yscale and this._xscale resize the image in percentage way.

And that this._y and this._x place the picture according to co ordinates.

and this._width and this._height resizes it according to pixels. So i should use this one to resize it. However when i try to resize it, it doesnt show up at all on the screen??????? but when i dont use this._width and this._height it does....

Any Ideas

Stop Images Resizing
Hi I have a quick question about presentation of images. I have a .swf of thumbnails on a scroller. When each of them is clicked their corresponding large image is shown on the page(js and actionscript). The original image that is there before anything is clicked is scan0002.jpg which has the following dimensions: width="537" height="354"
This means that every other image also has these dimensions which is not what I want. How do I control the image size that the other images are output? How would I do that please?
I pasted the actionscript for the first two buttons (and the javascript) below. Thanks for any help
html:
<td width="538" align="left">
<!--- existing photo that users see--->
<div id="image1">
<img src="images/scan0002.jpg" width="537" height="354" name='image1' id='image1'></div>
<div><!---first image presented here images/P01.jpg---></div>
<div><!---second image presented here images/P02.jpg---></div></td>

flash actionscript:
button 1 (first image):
on(release){
getURL("javascript:MM_swapImage('image1','','image s/P01.jpg',1)");
}

button 2:
on(release){
getURL("javascript:MM_swapImage('image1','','image s/P02.jpg',1)");
}

javascript:
<script language="JavaScript" type="text/JavaScript">
<!--

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

Displaying And Resizing Images
im trying to load some external photos through XML into a flash file, the photos ive got are quite big and it is going to take ages to resize them seperately,
im just trying to find out if there is a script which will resize and display my images ? ?

thanks for any help

Resizing Images In Flash 8
I'm having serious problems when trying to resize the photos in my slideshow to be contained in a box. They keep fluctuating between a correct size and their original size. Below is my function. When I set the xscale and yscale to known values, i.e. 50, it works fine, but as soon as I change it to be more Object oriented, it fails. Any ideas?? Thanks!!


Code:
function resizeImage(){
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
//Picture is the movieclip where the pictures are loaded.
//Border is the movieclip border within which I need
// the image to be contained.
var picW = picture._width;
var picH = picture._height;
var borW = border._width;
var borH = border._height;
scale = yscale = xscale = 100;

if((picW > borW) && (loaded == filesize) && (loaded > 10)){
scale = (borW / picW)*100;
xscale = scale;
}
else if((picH > borH) && (loaded == filesize) && (loaded > 10)){
scale = (borH / picH)*100;
yscale = scale;
}
else if ((loaded == filesize) && (loaded > 10)){
xscale = yscale = 100;
}
scale = Math.min(xscale, yscale);

picture._xscale = picture._yscale = scale;
picture._x = border._x + ((border._width - picture._width)/2);
picture._y = border._y + ((border._height - picture._height)/2);
border._visible = true;
}

Resizing Images At Runtime
I have a flash 8 file that I pull in images through an xml document. I have them loading into a movieclip instance, but becuase there is a lack of realistate, the images are pretty small. Is there a way I can have the end user click on or drag the picture to a larger size for viewing?

Resizing Images In Classes
Anyway the code below I just transferred from my fla file to a separate class file. Anyway I can guarantee you everything works except the image resizing. I can also guarantee that the event is called on stage resize but the image wont resize. It worked fine in the fla, does anyone know what's going on?


ActionScript Code:
class classes.drawing.Contents extends classes.drawing.DrawingCoordinates {
   
    private var oListener:Object;
    private var mcLoader:MovieClipLoader;
   
    function Contents(mcTarget:MovieClip) {
        getCoordinates();
        mcTarget.createEmptyMovieClip("mcContents", 98);
        _mcTarget = mcTarget;
        fillBg("images/bg.jpg");
    }
   
    private function fillBg(bgLocation:String):Void {
        _mcTarget.mcContents.clear();
        oListener = new Object();
        oListener.onLoadInit = function() {
            _mcTarget.mcContents._x = _xLeft;
            _mcTarget.mcContents._y = _yTop;
            //scales the image but maintains proportion
            if(Stage.height > _mcTarget.mcContents._height or Stage.width < _mcTarget.mcContents._width){
                _mcTarget.mcContents._height = Stage.height;
                _mcTarget.mcContents._xscale = _mcTarget.mcContents._yscale;
            }
            if(Stage.width > _mcTarget.mcContents._width or Stage.height < _mcTarget.mcContents._height){
                _mcTarget.mcContents._width = Stage.width;
                _mcTarget.mcContents._yscale = _mcTarget.mcContents._xscale;
            }
        }   
        mcLoader = new MovieClipLoader();
        mcLoader.loadClip(bgLocation, _mcTarget.mcContents);
        mcLoader.addListener(oListener);
    }
   
}

Thanks.

Resizing Images On Upload
I wish to automatically rezise files as I upload them, and I am at a loss to understand how I might achieve this. Here is the code I am using (it allows for multiple file selection):


ActionScript Code:
var fileRefList:FileReferenceList = new FileReferenceList();
fileRefList.addEventListener(Event.SELECT, selectHandler);
fileRefList.browse();

function selectHandler(event:Event):void
{
    var request:URLRequest = new URLRequest("http://www.[yourdomain].com/upload/");
    var file:FileReference;
    var files:FileReferenceList = FileReferenceList(event.target);
    var selectedFileArray:Array = files.fileList;
    for (var i:uint = 0; i < selectedFileArray.length; i++)
    {
        file = FileReference(selectedFileArray[i]);
        file.addEventListener(Event.COMPLETE, completeHandler);
        try
        {
            file.upload(request);
        }
        catch (error:Error)
        {
            trace("Unable to upload files.");
        }
    }
}
function completeHandler(event:Event):void
{
    trace("uploaded");
}

I wish to resize the files as they are uploaded. I have thought about importing them as sprites, then saving them as bitmaps, then uploading them:


ActionScript Code:
public static function spriteToBitmap(sprite:Sprite, smoothing:Boolean = false):Bitmap
{
var bitmapData:BitmapData = new BitmapData(sprite.width, sprite.height, true, 0×00FFFFFF);
bitmapData.draw(sprite);
return new Bitmap(bitmapData, “auto”, smoothing);
}

but I cannot work out how to actually get the sprite into the AVM before it uploads.

Any ideas?

(desperate-ish)



Any ideas?

Resizing Mc Loaded Images
Hi

I need for an image that loads to an mc to be resized to the size of the mc while keeping proportions . the images are loaded by users so the image name is always different.

this is the code that loads the image i guess I just need the part of the code that resizes it.

this code is on the same frame that the mc is on the timeline:


Code:
stop();
if (_root.contenturl1 == "") {
loadMovie("img1" add _root.zimgpage add ".jpg", "img1");
} else {
loadMovie(_root.contenturl1 add "/" add _root.userid add "/img1" add _root.zimgpage add ".jpg", "img1");
}
the movie publishes in flash player 6 and is actionscript 1.0

Please any help with this is appreciated.

Flash Is Resizing My Images
i have read in images from an xml file. The width and height are read in and they are created dynamically. It reads in the correct size and then when i export the swf it srinks the images down. Is there something that i need to set to prevent this from happening?

Resizing Images Without Pixelation
Hi everyone

This is a topic that everyone seems to be wondering about but nobody has the answer. If you look at a site like www.manipulator.com , the screen can be resized and the images will increase along with it (until a certain point of course) but at no point do the images pixelate? Where as my images do not matter how good the quality or picture format.

If anybody has any ideas how this is done I would be greatful!

Thanks

SG

Images Resizing On Import
Hello All,

Using Flash CS3 Pro, and when I import PNGs or JPEGs they are being shrunk by about 30%. Any Ideas as to why this is happening? I've checked the size of the images in several other app.s They are 158pix x 113pix but once imported into Flash, they're 118.5pix x 84.8pix. Any help or direction would be much appreciated.

Opening Images And Resizing
Hi,

I found this cool effect when opening images and was wondering if anyone knew if there was a tutorial anywhere on it, I have seen it on a few sites so assumed it must be around somewhere. Here is an example, just select an image from the selection at the bottom and watch the image open, here is the link:

http://www.conceptart.org/?artist=JasonChan

thanks

Gavin

Resizing And Centering The Images
hi,
can someone tell me simple basic code for resizing and centering the images on the stage while loading from xml.

i searched in the forum but many of them are using movie clip loader. so they have used getBytesLoaded or getBytesTotal for this.

And i have developed my gallery using loadMovie.

so can someone help me regarding this??

waiting for ur help

thanks a loooooooooooot:

Resizing Images Using Actionscript Help Please.
I’m trying to load different images into flash dynamically. All these images are different sizes. Is there any way I can resize the image length and width once it’s in flash. Or resize the movie clip it’s loaded into? Everything I’ve tried so far isn’t working. I’d appreciate any help, cheers.

Fading In And Resizing Images From An .XML
I have created an XML based photo gallery. Its split into two parts, the thumnail holder and the main image holder. When you click a thumbnail, the image loads fine. However I would like the image to automatically resize when a thumbnail is clicked, and for the image to fade in, not just appear!
Any idea anyone? They would be much appreciated!!
Jen

Here is my action script code so far >



Code:

myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load("gallery2.xml");
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 70;
for (i=0; i<numimages; i++) {
picHolder = this.firstChild.childNodes[i];
thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
thumbHolder._x = i*spacing;
thumbHolder.title = picHolder.attributes.title;
thumbHolder.main = picHolder.attributes.main;
thumbLoader = thumbHolder.createEmptyMovieClip("thumbnail_image"+i, i);
thumbLoader.loadMovie(picHolder.attributes.thmb);
thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
}
};
}

Resizing Images Without Distortion
i was taking a look at today´s FWA winner ==> Verragio.com and was wondering how they make the pictures to resize so nicely withou distortion on the gallery buttons.

Anyone could give some ideas?

Getting My Head Around Resizing Images
I have a main image on the first screen of my flash website. The size of the flash site is set to 800 x 600.

On larger moniters the flash site looks fine (obviously cos its vector based) but the main image degrades pretty rapidly if the site gets stretched.

I know how to upload an image using loadMovie and keep it separate from the flash movie file but what I can't get my head around is how the resolution will change depending on the size of the flash site within different browser windows.

If I set a movieclip as a place holder for the image and then get it to load an external jpeg file that resizes to the place holder dimensions what happens if you stretch the size of the place holder. If a flash movie is resized according to a browser window, do the values of the dimensions of the flash symbols change or are they always set at the size they were created?

Whats the best way to get an image to resize with the flash website and keep the resolution at a maximum at all times?

Help *XML Photogallery* Resizing The Images
Hi all, I've pieced together a photo gallery based on what I learned from this tutorial:

http://www.kirupa.com/developer/mx20...otogallery.htm

Can someone tell me how I dynamically resize the images that are loaded into Flash. I want to resize the window in which they are displayed, so a 400x400px photo will display at 150x150px, for example. If you want to help but don't feel like checking out the tutorial, please let me know and I will fish out whatever code I think this solution would concern.

~Jason

Resizing Images Into Slideshow FLA
I am elated to have finally gotten a slide show with thumbnails but am trying to hack into the files so I can load a larger image than the ones plugged in to the file. The tutorial that I am referring to is this: http://www.kirupa.com/developer/mx2004/thumbnails.htm. I went through the steps which were very straightforward by the way! - (many thanks to the guru that posted this tutorial!!!!!!) The files were uploaded to my site with my images --> http://www.oregonvisions.com/Flash_s...how/arch2.html but I can't seem to find where to hack into the file to make the background not only centered but have my images positioned onto the background. I tried to simply resize the area layer which is masked but that did not work. ANyone out there know how to fix this???

Many thanks in advance..

Shekman

Resizing Loaded Images
oh so ive been looking around and cant find the answer to this..
im loading images into a gallery type movie. in my function thats called when the loading is complete i try to resize the image using maybe different methods.

1)tried setting the loaders width and height
2)tried setting the loaders.content width and height
3) calculating the scaleing factor to and using the loaders scaleX and scaleY
this then caused it to scale only in the y. at first thought it was trying to maintain aspect but then relized (when giving up and scaling so the largest side still fit) that the x isnt changing at all? i then tried just changing the scaleX and it doesnt do anything?

code im using:
ActionScript Code:
myLoader.scaleX = 520/myLoader.contentLoaderInfo.width;
myLoader.scaleY = 300/myLoader.contentLoaderInfo.height;

if i take out the Y line nothing happens its as if it doenst run the scaleX

XML, External Images And Resizing
Hi there,

I've been puzzling with this for quite a bit. I went through a ton of xml+cs3 tutorials, and quite a few external images ones. I think I got them both nailed. The xml+cs3 tutorial on this website really shone a light on how this integration works.

However I want to have an xml that feeds a couple of nodes to an image loader. A horizontal image scroller to be exact.

So I know how to load an external image, through using an url and a movieclip. I know how to read a xml-file and how to filter it. But I can't get a grasp on how to read an xml-file and use the urls found there to load the images.

The xml file looks like this:

<gallery>

<foto id="1">
<loc>fotos/foto1.jpg</loc>
<thumb></thumb>
<desc></desc>
</foto>

<foto id="2">
<loc>fotos/foto2.jpg</loc>
<thumb></thumb>
<desc></desc>
</foto>

</gallery>

Loc being the location of the photo. (Thumb the thumbnail, desc the description - but this is for a later date)

How do I get my horizontal gallery to display foto 1, 2 and 3 next to eachother in boxes of 110x110px? It sounds so simple...

Thanks in advance

Resizing Images Using Actionscript Help Please.
I’m trying to load different images into flash dynamically. All these images are different sizes. Is there any way I can resize the image length and width once it’s in flash. Or resize the movie clip it’s loaded into? Everything I’ve tried so far isn’t working. I’d appreciate any help, cheers.

Fading In And Resizing Images From An .XML
I have created an XML based photo gallery. Its split into two parts, the thumnail holder and the main image holder. When you click a thumbnail, the image loads fine. However I would like the image to automatically resize when a thumbnail is clicked, and for the image to fade in, not just appear!
Any idea anyone? They would be much appreciated!!
Jen

Here is my action script code so far >



Code:

myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load("gallery2.xml");
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 70;
for (i=0; i<numimages; i++) {
picHolder = this.firstChild.childNodes[i];
thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
thumbHolder._x = i*spacing;
thumbHolder.title = picHolder.attributes.title;
thumbHolder.main = picHolder.attributes.main;
thumbLoader = thumbHolder.createEmptyMovieClip("thumbnail_image"+i, i);
thumbLoader.loadMovie(picHolder.attributes.thmb);
thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
}
};
}

Resizing Loaded Images
Hi, i have a problem. I want to be able to resize all images that are loaded into my flash movie to 700x450.

How can i go about doing this??

Any ideas??

Regards,

Martin

Computing Help And Info:
http://www.webrevolt.biz

Images Resizing On Import
Hello All,

Using Flash CS# Pro, and when I import PNGs or JPEGs they are being shrunk by about 30%. Any Ideas as to why this is happening? I've checked the size of th images in several other app.s They are 158pix x 113pix but once imported into Flash, they're 118.5pix x 84.8pix. Any help or direction would be much appreciated.

Resizing Of Bitmap Images
Hi,

I have gallery in Flash 8 and want to ask if it is possible to load and then resize the jpeg images in Flash to be used as both original-sized and thumbnails. So flash loads the image only once, firstly scale it down and if user selects that thumb then it show the original-sized image? How to scale the images to have quality as it was scaled in Photoshop? With BitmapData filter??

THANKS A LOT !!
cr3n

Resizing Multiple Images...
I've been trying to get this to work for days... I am loading a jpg into an empty movie clip, then creating a border around it, then resizing it. It works fine if I have one image, but if I have two, the first one loads and draws the border, but doesn't resize - the second one processes correctly. I've tried moving the resizing (_width & _height) around, but if I move it outside of the "loaded" loop (checks to see if the image has finished loading), the image doesn't show up at all! Here's the code I'm using:


PHP Code:



function preloadImg(myImage,imgMC_id,imgMC,x,y,depth){
    var o:MovieClip = this.createEmptyMovieClip(imgMC, depth);
    o.loadMovie(myImage);
    o._x = x;
    o._y = y;

    _root.onEnterFrame = function() {
        createBorder(o);
        var myLoadedBytes = o.getBytesLoaded();
        var myTotalBytes = o.getBytesTotal() ;
        var myPercent = Math.floor((myLoadedBytes/myTotalBytes)*100);
        
        if (myPercent == 100) {
            resizeImg(o,110,110);
            _root.onEnterFrame = null;
        }
    }    
}

function resizeImg(o,w,h) {
    o._height = h;
    o._width = w;
}

function createBorder(mc){ 
    imgW = mc._width + 2; 
    imgH = mc._height + 2; 
    with(mc){ 
        lineStyle(5,0x000000,100); 
        moveTo(0 ,0); 
        lineTo(0,imgH); 
        lineTo(imgW,imgH); 
        lineTo(imgW,0); 
        lineTo(0,0); 
    } 


var cvrImg:String = details_lv.cover;
var backImg:String = details_lv.back;
if(cvrImg != "") {
    var cvrURL:String = "http://www.mysite.com/images/" + cvrImg;
    preloadImg(cvrURL,"cvrImg","cvrImg_mc",446,286,1000);
} else {
    cvrImg_mc._visible = false;
}
if(backImg != "") {
    var backURL:String = "http://www.mysite.com/images/" + backImg;        
    preloadImg(backURL,"backImg","backImg_mc",446,400,1001);
} else {
    backImg_mc._visible = false;
}

// If I remove the resizing from the function above, and do it here instead, I get NO images at all...
resizeImg(cvrImg_mc,110,110);
resizeImg(backImg_mc,110,110); 




Any help? I really appreciate it!!

Eddie

Copyright © 2005-08 www.BigResource.com, All rights reserved