A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Very useful! Stretching swf files but NOT imported raster images to retain quality

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    11
    I have a pretty tough problem to crack. If you can answer this, then I'll be eternally grateful to you. I truly hope there are Flash experts out there. I'll try and be as detailed as possible because I think the answer to this question will be infinitely useful to others!

    I'm a Web Designer creating a flash site that fills the entire screen regardless of one's display settings. In short, I'm editing the HTML as follows:

    <EMBED SRC="index.swf" quality=high bgcolor=#000000 WIDTH=100% HEIGHT=100%>

    index.swf is 600 pixels wide and 400 pixels high.

    The code in the html obviously stretches the swf to fill the entire screen (i.e. 800 x 600 display). No big deal, right?

    Now here's my problem. Unfortunately I have some raster images (jpgs) that need to be imported into the movie. These images are not available as vector originals, so I have no choice but to work with them. I've brought them into the flash file as graphic symbols. However they look awful when I export the movie and the html tags stretches the swf across the browser screen.

    Okay, okay I know I can trace bitmap them into vector graphics. They scale beautifully and all but the file size of the swf becomes way way too big. I've toyed with the trace bitmap settings to balance quality vs. compression an infinite number of times. No luck. Besides what would I do if I had many jpgs I wanted to display? No one is going to wait for this monster of a file to come down the pike at them. Therefore I've ruled out trying to convert raster to vector.

    Surely someone out there has run into this problem before. I'll summarize it in a nutshell: it is imperative that my flash movie stretch across the display screen. Is there a way to have my swf stretch but not the imported raster images in it? The raster images need to retain their original pixel dimensions (or something close to it) in order to prevent major distortion.

    Raster images are a fundamental part of Web design. Most sites use them. Therefore, Flash has to have a way to deal with them other than creating unwieldy file sizes with the trace bitmap tool. I know some of you are going to say, just don't stretch the swf file. But you don't want movies taking up only 1/4 of the screen on monitors displaying at 1024x768 or greater. Plan HTML sites can handle this by allowing you to stretch tables as a percentage of the screen size. And the raster images do not stretch. Surely a powerful tool like Flash didn't ignore such important things. Okay, I've tried to be as detailed as possible because I want true Flash experts to help me here. Thanks!

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Posts
    266
    You know original size of your movie, ok?

    You can get current screen resolution using JavaScript.

    So, you can calculate how much your movie is stretched
    and accordingly reduce _xscale and _yscale properties of movie clips in your movie (you need to put all your bitmaps into movie clips and name their instances).

  3. #3
    Junior Member
    Join Date
    Apr 2001
    Posts
    11
    Thanks Kost. I tried playing around with the _xscale and _yscale properties but I don't know how to access the amount the screen is stretched by. Regardless, the GetProperty and SetProperty commands appear to still stretch the raster images whenever the original movie is stretched. Could you give me an example of such a script? I'd greatly appreciate it.



    Originally posted by kost
    You know original size of your movie, ok?

    You can get current screen resolution using JavaScript.

    So, you can calculate how much your movie is stretched
    and accordingly reduce _xscale and _yscale properties of movie clips in your movie (you need to put all your bitmaps into movie clips and name their instances).

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Posts
    266
    Try the sample I created:

    http://kost.timus.ru/sample/resize/menu.html
    (its .fla is very simple and located at
    http://kost.timus.ru/sample/resize/resize.zip )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center