Solved

Using the LoadMovie function in Flash Mx?

Posted on 2002-05-25
2
416 Views
Last Modified: 2008-03-03
I have a program that uses the LoadMovie build in function to load dynamic jpg image files. ie.
loadMovie("../images/mypicture" + i + ".jpg", "Pictures");

Is there a way to make the jpg image display in a fixed
width and height, no matter what size the jpg file is?
0
Comment
Question by:7of9121098
[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 23

Expert Comment

by:Zeffer
ID: 7034991
If you target a Flash movie as a template for
receiving the .jpgs the images will inherit the
properties of the target movie..This will display
the images using whatever properties you have set for
the movie...see below from ActionScript Help.

Loadmovie...
>>
Action; load a SWF or JPEG file into the Flash Player while the original movie is playing. The loadMovie action lets you display several movies at once and switch between movies without loading another HTML document. Without the loadMovie action, the Flash Player displays a single movie (SWF file) and then closes.

When you use the loadMovie action, you must specify either a level in the Flash Player or a target movie clip, into which the movie will load. If you specify a level, the action changes to loadMovieNum. If a movie is loaded into a target movie clip, you can use the target path of that movie clip to target the loaded movie.

A movie or image loaded into a target inherits the position, rotation, and scale properties of the targeted movie clip. The upper left corner of the loaded image or movie aligns with the registration point of the targeted movie clip. Alternatively, if the target is the _root Timeline, the upper left corner of the image or movie aligns with the upper left corner of the Stage.

Use the unloadMovie action to remove movies loaded with the loadMovie action. <<

Z

0
 
LVL 6

Accepted Solution

by:
rootdir earned 50 total points
ID: 7035729
I think you have to scale the targetmovie everytime like this to get fixed width.

targetmovie_width=_root.Pictures._x
width_percent = (Fixed_width / targetmovie_width) *  100
_root.Pictures._xscale=width_percent

targetmovie_length=_root.Pictures._y
length_percent = (Fixed_length / targetmovie_length) *  100
_root.Pictures._yscale=length_percent

That's it. Still if you don't get results upload your fla file  or send it to me at rotdir@hotmail.com.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
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…
The goal of the tutorial is to teach the user how to how to record live broadcast.
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.

707 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