Solved

Changing Image Size with Action Script

Posted on 2008-06-20
2
856 Views
Last Modified: 2013-11-11
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
Comment
Question by:MojoRisin2
2 Comments
 
LVL 17

Expert Comment

by:Dushan De Silva
ID: 21843834
You can set    _xscale , _yscale parameters.
0
 
LVL 12

Accepted Solution

by:
SamuelRostol earned 500 total points
ID: 21855083
Well, since this is AS3, you'll have to set the scaleX and scaleY parameters of the image :)
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question