PDA

View Full Version : External Pics ... Loading and Resizing



prodigymunky
07-29-2005, 04:53 AM
Here's one for y'all ...

I'm loading an external picture using :

frameName.loadMovie("http://www.mysite.com/picName.jpg")

Up to there it works

I know the size of the picture (dimensions) is bigger than what I want to display it at, so I tried putting the following code right after the previous code :

frameName._width = 128;
frameName._height = 96;

But when I do this, the picture disappears from the flash movie.

So I tried waiting a while in the main movie, then resizing it. It worked, but I don't want the time where the picture is big before the movie resizes it.

Understand?
Can anyone help???!!!

NTD
07-29-2005, 11:04 AM
Hi,

Welcome to the forum. You can size and load an external non progressive .jpg image. The trick for resizing is that it can't be done until the image has fully loaded. A workaround for this is sizing the movieclip holder than your loading the image into. Assuming "frameName" is the instance name of a movieclip, it would look something like...



_root.onLoad = function() {
_root.loaded = true;
}
this.onEnterFrame = function() {
if (_root.loaded == true) {
return;
}
if (_root.frameName._width>0) {
with (_root.frameName) {
_x = 100;
_y = 100;
_width = 100;
_height = 100;
}
_root.loaded = true;
delete this.onEnterFrame;
}
}
myButton.onRelease = function() {
_root.loaded = false;
_root.frameName.loadMovie("someFile.jpg");
}


The movieclip image holder should be empty or created with createEmptyMovieClip(). This allows you to size and position a loaded image.

Regards
NTD