[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 863
  • Last Modified:

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

0
MojoRisin2
Asked:
MojoRisin2
1 Solution
 
Dushan De SilvaTechnology ArchitectCommented:
You can set    _xscale , _yscale parameters.
0
 
SamuelRostolCommented:
Well, since this is AS3, you'll have to set the scaleX and scaleY parameters of the image :)
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now