# Help me please, trying to scale the swf's horizontal attributes but not the vertical!

**URL:** https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451
**Category:** flash
**Created:** [August 10, 2004, 1:28am UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451 "2004-08-10T01:28:57Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![malidia](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/malidia/32/684_2.png) [@malidia](https://forum.kirupa.com/u/malidia)
#### Post date: [August 10, 2004, 1:28am UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/1 "2004-08-10T01:28:57Z")

</div>

I am trying to figure out how to precentage scale the horizontall values of an swf in flash but allow the vertical to go past the browser space create scroll bars, i can’t figure out how to make sure flash makes the horizontical value of the swf is maximized at 100 where the vertical is left up to the composition yet fills out the rest of the ratio of the original swf file, ( so the it does not stretch the swf)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 10, 2004, 2:07am UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/2 "2004-08-10T02:07:30Z")

</div>

I’m not quite sure exactly what you’re talking about, but if you want to strech a movieclip’s x and y scale you simply type is something like this:

```auto

mc._xscale *= .75
mc._yscale *= .75

```

Those two lines of code would adjust a movieclip to 75% normal size. Hope that helps

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 10, 2004, 2:21am UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/3 "2004-08-10T02:21:22Z")

</div>

No, he is talking about the flash file being displayed in a browser- he wants it to stretch horizontally, but have its height be a given value. Try embedding it with something like width=100% height=200 in its embed tag.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 10, 2004, 3:24am UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/4 "2004-08-10T03:24:30Z")

</div>

it’s she, 😉 but anyway, OK, say i have a swf file that is 1000 pixels horizontal and 2000 pixels vertical, i want this to display in the browser so that the swf is maximized horizontaly, therefore filling the browser window without a horizontal scroll bar; yet i want the swf to keep it’s 1000 pixel X 2000 pixel ratio (no stretching) so if the browser widow was 800 horizontal X 600 vertical in theory, the swf would strecth so that the horizontal would conform to 800 and then the vertical would automatically adjust to 1600 pixels if my math is correct, sorry about the confusion, so

width=100% height=200

wouldn’t really work, because the height value is specific, where the browser size is variable

thank you anyway…but i still need help

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 10, 2004, 2:03pm UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/5 "2004-08-10T14:03:26Z")

</div>

Let me get this straight. you wan a swf to fill up the entire browser window say 1000x1000. Your swf is 1000x2000. if this is right why don’t you just mask the space that you don’t want showing at the time and put the scroller on it.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 11, 2004, 4:31pm UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/6 "2004-08-11T16:31:37Z")

</div>

Nope i if my swf is 1000x2000 and the browser window is 1000X1000 i want the swf to be 1000X2000 because the horizontal matches 1000, i want the borizontal to fit the browser window but i want the vertical to stay porportionate to the original swf, (that does not mean it needs to stay exact) so that no strecthing occurs, can some please please help me!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 11, 2004, 7:36pm UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/7 "2004-08-11T19:36:14Z")

</div>

> [@malidia](#):
>
> it’s she, 😉

:ninja: Oops, sorry :pir:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 11, 2004, 7:44pm UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/8 "2004-08-11T19:44:32Z")

</div>

is this what you want just publish with html

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 14, 2004, 9:28pm UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/9 "2004-08-14T21:28:38Z")

</div>

no it’s something like width="%100" height=“scalable” or stretch, false or something

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 14, 2004, 10:05pm UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/10 "2004-08-14T22:05:50Z")

</div>

i think you can arrange that with setting the Stage properties… try something with Stage.widht and Stage.scalemode (just look in the flash help for Stage) maybe that will help you further…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2004, 8:03pm UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/11 "2004-08-19T20:03:24Z")

</div>

hmmm, maybe (width=100%)(height=\*) will work\>? maybe i will try that when i get home

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2004, 9:08pm UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/12 "2004-08-19T21:08:02Z")

</div>

To accomplish what you’re going for, you’re going to need some JavaScript.

Write a function that will calculate the height and width values for the SWF. Then, add something like \<body onresize=“scaleSWF()”\>. Just have the function communiate to the object/embed tag via the NAME attribute or something like that and you should be golden.

I think that’s about the only solution you’re going to have available to you.

You could also try nesting your main MC (the one that you’re trying to scale) inside of another blank MC that simply is set to width=100% height=100%, and then scale your main SWF via one of the methods listed above.

That’s a tough trick, but it is very do-able. I’d suggest the javascript route, it’ll probably have the most consistent results. 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2004, 9:15pm UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/13 "2004-08-19T21:15:07Z")

</div>

> **[can I control body onResize handler by script?](https://www.experts-exchange.com/questions/21050560/can-I-control-body-onResize-handler-by-script.html)**
>
> Hi, I've got this real poser. I have a page with an onResize handler, which makes the page non-valid HTML. I'd like to get this page compliant, but the whole layout scheme is controlled by it...

Just create a BS login and check the solution on this page. It’s the onResize function you need. All you’d have to do is paste it into your HTML and write the function that scales the SWF.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2004, 9:37pm UTC](https://forum.kirupa.com/t/help-me-please-trying-to-scale-the-swfs-horizontal-attributes-but-not-the-vertical/60451/14 "2004-08-19T21:37:47Z")

</div>

thanks a lot mister, you have been a great help :flower: let’s just hope i can get this going.
