Knowzy
01-19-2010, 12:56 AM
Greetings ActionScript.org.
I'm a Flash newbie and I'm hoping you can get me past my final hurdle on this project: Scaling the image to the size of the movie.
I'm using the following code to load a jpg onto the stage:
Stage.scaleMode = "showAll";
var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.loadClip("Surfcat-1149741464.jpg", container);
// I hoped something like this would work but Stage.height is undefined in the debugger.
//container._height = Stage.height;
//container._width = Stage.width;
The picture seems to expand the size of "container" beyond the stage and you only see the top-left corner. I'd like to smoothly scale it to fit the size of the stage, while maintaining the aspect ratio.
Note that while I'm developing using Flash CS3 Pro, I am targeting Flash 7/AS2 by design for two reasons:
I want the movie to play, even if my visitors haven't updated their Flash Player since 2003 (http://en.wikipedia.org/wiki/Adobe_Flash_Player#History).
Flash 7 has smooth scaling built-in (http://actionscript.org/forums/showthread.php3?t=89255&highlight=smooth) as long as you choose "Best" quality.
Can anyone point me in the right direction?
I'm a Flash newbie and I'm hoping you can get me past my final hurdle on this project: Scaling the image to the size of the movie.
I'm using the following code to load a jpg onto the stage:
Stage.scaleMode = "showAll";
var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.loadClip("Surfcat-1149741464.jpg", container);
// I hoped something like this would work but Stage.height is undefined in the debugger.
//container._height = Stage.height;
//container._width = Stage.width;
The picture seems to expand the size of "container" beyond the stage and you only see the top-left corner. I'd like to smoothly scale it to fit the size of the stage, while maintaining the aspect ratio.
Note that while I'm developing using Flash CS3 Pro, I am targeting Flash 7/AS2 by design for two reasons:
I want the movie to play, even if my visitors haven't updated their Flash Player since 2003 (http://en.wikipedia.org/wiki/Adobe_Flash_Player#History).
Flash 7 has smooth scaling built-in (http://actionscript.org/forums/showthread.php3?t=89255&highlight=smooth) as long as you choose "Best" quality.
Can anyone point me in the right direction?