[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Importing images with a fixed size.

Posted on 2002-07-12
9
Medium Priority
?
272 Views
Last Modified: 2010-04-03
Something similar has been asked before, but no real solution was found.

I would like to import an image of let's say 600x300 pixels. But when launching the movie in a 1024x768
browser this image is resized and looks awfull.

Is there a smart solution to this? A hidden 'noresize' parameter would be wonderful :-)

Thanks,

Wim
0
Comment
Question by:Wimmeke
[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
  • 5
  • 4
9 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 7151036
there is no magic fix for an image that is already in a swf file.The way to control it's size no matter what the resolution of the browser ...is to use the loadMovie function at runtime and place the .jpg file into a target movie of a specified pixel size...in this case a blank movie..600x300px.

Z
0
 
LVL 1

Author Comment

by:Wimmeke
ID: 7156031
Ok, I created a new movie (swf) file and made it's size 600x300. I loaded this with the loadmovie function in my
main movie (on release of a button).

The loading itself works fine, but the image is still resizing together with the browser.

Am I doing something wrong?

Ps: Why is this so difficult?

Greetings,

Wim
0
 
LVL 23

Expert Comment

by:Zeffer
ID: 7156133
HI.I think there are a couple of issues going on here.

Flash movies are scaleable and if you re-size the browser window everything in the movie is scaled up or down.

This is what you are doing now.

If your main movie is say 700x400 and it is exported with absolute dimensions (stated in pixels say...set in document properties)..then the movie will display at 700x400 in a 800x600 res.(your jpg will be 600x300)  
It will also display at 700x400 in a 1024x768 res.(your jpg will still be 600x300).. Both movies can be re-sized in their respective browsers though and all content will be scaled up.

So the absolute dimensions for the movie will control how it looks on launch in 1024x768..but you can't stop the user re-sizing their window and increasing the size of the jpg.

I see now why there has been no definative answer to this!

There is however a new actionscript command in MX..(Stage.resize)..which can invoke a function that basically redraws the objects on the stage..havn't tried it yet but in theory the jpg should be able to be called at it's original size...while the rest of the content resizes.

so your hidden "noresize parameter' may in fact be a reality..

maybe someone else has already done this and can help..I'm going to experiment and see if I can make it work.

Z

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:Wimmeke
ID: 7156201
Great, thanks ... I will try to have a look at it myself tomorrow.

One small comment though: The main movie has to be scalable, so it has to resize itself to the full browser window (As it is doing now). I tried using a fixed size and yes, then it works. But it really should stay proportional.

Anyways,

We'll see what we can find tomorrow.
0
 
LVL 23

Expert Comment

by:Zeffer
ID: 7156330
will be out of the loop for a few days from tomorrow..(travel)
factor in this from Macromedia if you are experimenting..

Stage.onResize

The syntax under the Usage heading is incorrect. Instead, use Stage.addListener with the Object.onResize callback method, as in the following:


myListener = new Object();
myListener.onResize = function () { ... }
Stage.addListener(myListener);

// later ...
Stage.removeListener(myListener);

Z

0
 
LVL 23

Accepted Solution

by:
Zeffer earned 400 total points
ID: 7176017
Hi Wimmmeke

sorry to be so long getting back to you.

Have had no luck with targeting a single bitmap..BUT..
here is a handy line of code to put in the first frame
of a movie..(I like it so much i'll be putting it in any
.swf which contain bitmaps..most of them)

Stage.scaleMode = "noScale";

>>Is there a smart solution to this? A hidden 'noresize' parameter would be wonderful :-)<<

it is in fact exactly that! If you try to find it in flash
reference it will tell you it doesn't know!..it is in the dictionary though..It does of course control the scaling
of the whole movie..but as
bitmap images are usually integrated with vectors..it keeps the movie looking exactly as we author it.

Z
0
 
LVL 1

Author Comment

by:Wimmeke
ID: 7176029
Greaaat!!
I will try this as soon as possible,
but unfortunately I'm in between two holidays and I have to study for a retake of a big test :-(

I will certainly tell you how it went ... and close this question of course :-)

Many thanks Zeffer,

Wim
0
 
LVL 1

Author Comment

by:Wimmeke
ID: 7176173
Couldn't resist trying this before I left :-)

So, here I go:

The Stage.scaleMode works fine, I also added an align left command. No probs there, but the movie itself had to be resized (The interface), so 'not scaling' the entire stage was no option.

But! I created a new swf file, imported a picture, broke it apart (Ctrl-B), Converted it to a graphic symbol and centered it. I added the noscale code to the first frame. Then I created a new empty videoclip in my main movie and added some code which would load the swf file (with loadMovie). So now the main movie resizes and
loads a 'not-wanting-to-scale' swf-file that contains the correct image.

Voila, my problem is solved. Although it is a bit cumbersome to put every image in a new swf. But I can create 1 swf which will dynamically load a picture. I can use a parameter to specify which picture he has to import.

Many thanks for the effort Zeffer

And see you later ;-)

, Wim


Ps: We should make this a component :-)
0
 
LVL 23

Expert Comment

by:Zeffer
ID: 7181334
Hey Wim..

What you came up with occurred to me as well...but
you got there sooner!
Good one..and yes I agree it should be a component..


Regards

Zeffer
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
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 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.

649 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