Link to home
Start Free TrialLog in
Avatar of deluxas
deluxas

asked on

how do i scale a movieclip proportionally in a flash as3 movie?

Hi,
I have a flash movie that will be resized by a width and heigh parameter in the html.  I need a particular movie clip to resize its self proportionally to fit the full width  of the movie, but have its height in proportion.  I have access to width and height of swf.
Thanks
Avatar of Eaddy Barnes
Eaddy Barnes
Flag of United States of America image

Hello

so your saying you want a movieclip within the swf to always be the width of the swf stage but you want the height to be proportional to the resizing of the swf?

GE
Avatar of deluxas
deluxas

ASKER

Hi, Yes exactly, the movieclip should scale proportionally while maintaining the width of the main stage
many thanks
Avatar of deluxas

ASKER

Just to add clarity, the clip in question is the control bar of a video player, containing the various buttons.  The player will be deployed at various sizes (width/height) so I need this movie clip to always span the width of the player but maintin its proportions.
many thanks
hello

sorry for the late reply. let me peace together a script to get that done
GE
i am
thinking you would have to directly tell the button panel BG to resize as needed instead of telling the entire movieclip to resize.
this way you would have more control over the the content and will be able to adjust the buttons as needed depending on the size
of your video currently loaded.

GE
Avatar of deluxas

ASKER

Hi, If I understand you correctly, you think I should have a background (perhaps invisible) within the controls movieclip, and target resizing this insted?
thanks
yes. targeting the symbols withing the movieclip directly would allow you more control over them.

GE
Avatar of deluxas

ASKER

Thanks for that, I almost have it working, scaling proportionally, but the remaining problem is this; within the control panel movieclip, sits the progress bar, which contains its own movie clip the span of which is greater than the control clips natural dimension, i.e even though this movieclip is invisible it affects how wide flash thinks it is, making using the width of the control bar movie clip itsel unreliable, any ideas greatly appreciated, thanks
you can make the progress bar functions on its own outside pf the movieclip so then you would have full controll over its functionality

GE

please let me know how its works or if you like you can show me your fla to i can help more

Avatar of deluxas

ASKER

Hi,
Many thanks for this.  The formula I'm trying to implement is like this.  I have the width and height of the flash movie provieded as a paramter movieHeight and movieWidth.  I was trying to set the dimensions of the control panel movieclip like this.

videoControls.width = movieWidth;
videoControls.height = stage.stageHeight - videoControls.height;

but this is malforming, obviously, as forcing the height to a fixed one will break the proportions.  Do you have any idea of a formula?
Many thanks
ASKER CERTIFIED SOLUTION
Avatar of Eaddy Barnes
Eaddy Barnes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial