[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

loadMovie() loading distorted .jpg file

Posted on 2005-04-25
10
Medium Priority
?
2,270 Views
Last Modified: 2012-05-07
Hello,

I have an empty movieclip that load a .jpg file dinamically. The thing is when I load the picture is shows distorted, like Flash is making the loaded .mpg file smaller. The original file size is 400x300 but in Flash it's not showing the real size.

How can I make the movieclip load the file in the exact original size?

I tryed to use:

movieclip._height = 400;
movieclip._width = 300;

But it's not really working or I don't know exactly where to place it.

I'm using Flash MX 2004 Professional.

Please provide accurate and fast input as this is an urgent one.

Thanx ;)
0
Comment
Question by:stefanaichholzer
10 Comments
 
LVL 9

Author Comment

by:stefanaichholzer
ID: 13857871
The file being loadad is a JPG picture, not .mpg, that´s a typo, sorry!

BTW, can I load .png files?

;)
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 13858124
Howdy...  :)

Flash cannot dynamically load PNG file...  :(

Try changing the scale to 99% after the JPEG file is fully loaded...

movieclip._xscale = movieclip._yscale = 99;
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 13858620
what script are you using to load the image.

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 13

Expert Comment

by:FLAASHER
ID: 13858788
MAmake sure u didnt skale the movie cip u load in

and plz upload the file if u can to see it and see the script u use


FLAASHER
0
 
LVL 9

Accepted Solution

by:
Jakob_E earned 1500 total points
ID: 13860563
My guess is that you load your image into a scaled movieclip this way your image will take the scale of the parent movie clip
You can fix this by reversing the scale of the parent clip.

An example:

// You have a "parentmovie" movie clip with a nested movieclip "container"
// You want to load your image into the nested "container"
var parentmovie = createEmptyMovieClip("parentmovie",0);
var container = parentmovie.createEmptyMovieClip("container",0);

// Your "parentmovie" is scaled
parentmovie._xscale = 50;
parentmovie._yscale = 200;

// To make sure your image does not look scaled you must compensate
// by scaling your "container" opposite of your "parentmovie"
container._xscale = 100/parentmovie._xscale*100
container._yscale = 100/parentmovie._yscale*100

// Now load the image
container.loadMovie("http://www.yourdomain.com/NonProgressiveImage.jpg");



If this does not fix your problem try have a look on your load script...
I normally use one one of these:

// Method 1 - The simple
// -----------------------------------------------------------------------------------------------
// Create a container to hold your image
var container = createEmptyMovieClip("container",0);
// Load image
container.loadMovie("http://www.yourdomain.com/NonProgressiveImage.jpg");


// Method 2 - Using lisetner
// -----------------------------------------------------------------------------------------------
// Create a container to hold your image
var container = createEmptyMovieClip("container", 0);
// Carate listnerobject
var loadListener:Object = new Object();
// On load complete...
loadListener.onLoadComplete = function(target_mc:MovieClip) {
  // When loaded do something...  
};
// Create movie clip loader
var mcl:MovieClipLoader = new MovieClipLoader();
// Add listener to movie clip loader
mcl.addListener(loadListener);
// Load image
mcl.loadClip("http://www.yourdomain.com/NonProgressiveImage.jpg", container);



Best, Jakob E


0
 
LVL 9

Author Comment

by:stefanaichholzer
ID: 13861478
Thank you for the input. I tryed all your suggestion and still the same issue.

I have this movieclip called objetc_image, which is insede another movieclip, like this:

 Scene
   - Clip 1
    - Clip 2
     - object_image

All the other clips are bigger and I don't have any problems with those. I don't know why the image is being displayed smaller. How in the world do I resize the object_image clip??

Thanx

;)
0
 
LVL 9

Author Comment

by:stefanaichholzer
ID: 13861511
Can I just mail it to anyone so you can look at it and fix it for me?

;)
0
 
LVL 9

Author Comment

by:stefanaichholzer
ID: 13861772
I just created something similar, with a just and just one movieclip in it, then I loaded a picture into it and it loaded fine. So, Jakob_E the problem might be in your direction.

Now, assume the parent clip from my (error) clip is galery, how would I go in a simple way and nicely explained to get the sub clip in the right size?

Thanx ;)
0
 
LVL 9

Author Comment

by:stefanaichholzer
ID: 13861805
Jakob E,

I tryed this:

container._xscale = 100/parentmovie._xscale*100
container._yscale = 100/parentmovie._yscale*100

but now the image is not being displayed at all!

;)
0
 
LVL 9

Author Comment

by:stefanaichholzer
ID: 13861980
It works fine now!

Thank you guys!

;)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

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…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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.
Suggested Courses

872 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