Solved

Changing Image Size with Action Script

Posted on 2008-06-20
2
854 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:Dushan911
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

914 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now