Solved

Changing Image Size with Action Script

Posted on 2008-06-20
2
859 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to record live broadcast.

636 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