Changing Image Size with Action Script

I have a flash movie which loads an image to stage from flash vars into an empty movie clip.

It works fine, but I would like to enhance the image loader. I would like to add a preloader to show up every time when an image is being loaded displaying % of loading. I would also like the image to expand its size from 0% to 100% on stage, every time it is loaded.

This is the code that I have so far:
function loaderComplete(myEvent:Event) {
	var flashVars=this.root.loaderInfo.parameters;
	var loader = new Loader();
	mc.addChild(loader);
	loader.load(new URLRequest(flashVars.imageFilename));
}
 
// This assigns the callback to be called when the movie has finished loading.
this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);

Open in new window

MojoRisin2Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
SamuelRostolConnect With a Mentor Commented:
Well, since this is AS3, you'll have to set the scaleX and scaleY parameters of the image :)
0
 
Dushan De SilvaTechnology ArchitectCommented:
You can set    _xscale , _yscale parameters.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.