Solved

Using the LoadMovie function in Flash Mx?

Posted on 2002-05-25
2
410 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
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
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 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 how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

759 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

21 Experts available now in Live!

Get 1:1 Help Now