Solved

Changing Image Size with Action Script

Posted on 2008-06-20
2
853 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

747 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

13 Experts available now in Live!

Get 1:1 Help Now