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

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)

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:

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

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

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.

it’s she, :wink: 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

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.

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!

:ninja: Oops, sorry :pir:

is this what you want just publish with html

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

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…

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

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. :wink:

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.

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