PDA

View Full Version : Images failing to load


Imager
06-26-2005, 04:37 PM
Hi,

Not sure if this is simple stuff or not but I am new to Flash anyhow....

I am trying to dynamically load images into a movie, as in...

var file1 = "c:\\elmcroft\\web\\web projects\\elm gallery 2\\gallery\\landscape\\wiggly road2.jpg";
var file2 = "c:\\elmcroft\\web\\web projects\\elm gallery 2\\gallery\\architecture\\TheEye2.jpg";
var file3 = "c:\\elmcroft\\web\\web projects\\elm gallery 2\\gallery\\people\\emma2.jpg";

imageMC = this.createEmptyMovieClip("Image", 1);
imageMC.loadMovie(file1);

this is obviously test code and when run it displays the first image on the stage fine, BUT when I run it with either file2 or file3 in the loadMovie call I get nothing just the background.
All filepaths are correct and I have tried putting the files in the same dir - with the same result.
All images open OK in Photoshop and all were edited in Photoshop before saving to their current dirs.
All files are of similar size ~40k.
I think that there must be something wrong with format of files 2 & 3 but what?

I'm using Flash MX - which I believe is AS1.

So can anyone tell me what else I can check or what is wrong?

Thanks for any help
MT

Ruben
06-26-2005, 04:54 PM
Well there are several things that could be causing the problem. For instance, flash can't load progressive jpg's during runtime (nor gifs or other formats).

Also, you might want to change the paths to this format:var file1 = "c:/elmcroft/web/web projects/elm gallery 2/gallery/landscape/wiggly road2.jpg";

Furthermore; if you load 2 images in the same movieclip like this for example:someClip.loadMovie("first_image.jpg");
someClip.loadMovie("second_image.jpg");then when the second line of code gets executed (loadMovie("second_image.jpg")) first_image.jpg will automatically be unloaded from someClip.

I hope that helps you out

- Ruben

Imager
06-27-2005, 08:30 PM
Ruben,

Thanks for the quick reply.. and for the info. I found that files 2 & 3 are progressive jpgs so I resaved tham as baseline and now all is fine.

Thanks again for the help.

Cheers
MT

Ruben
06-27-2005, 09:44 PM
No problem, glad you found your bug so fast

:cool: - Ruben