Scaling in flash
- Started
- Last post
- 12 Responses
- jevad
I do believe this is my first flash question here....second actually...
Anyway...I have a flash movie...it has a background...and a content movie in the middle. I'd like the background pattern to scale out (but not get bigger), and the content to stay the same size centered in the browser - any tips?
thanks
- versa0
you mean like a tile in html, but instead a dup'd mc in flash...
i might be confused what you need
- JamesEngage0
hmm... don't understand
- unfittoprint0
in the html, make your swf width and height equal 100%.
In your flash movie use the following code [in an action layer]:
// top, center position
Stage.align = "T";
// Prevent scaling
Stage.scaleMode = "noScale";// Create the listener object
resizeListener = new Object();
resizeListener.onResize = function () {
contentMC._x = (Stage.width - contentMC)/2;
backgroundMC._x = (Stage.width - backgroundMC)/2;
trace("New width: " + Stage.width);
};Stage.addListener(resizeListener...
- jevad0
what I mean is - you know in html you can have a tiled background and your website will stay centrered in the middle of your browser and the bg will expand along the width and height when you resize your browser - can you do that same in flash?
- jevad0
like this!
- JamesEngage0
cool... what unfit said... these guys do it expertly, sort of... well they don't, but it's similar...
- jevad0
versa, unfit, engage - many thanks - I will try it out!
: )
- err0
Awsome I had the same type of question. So that background will show through my MC?
I wanted a tiled background but my Movie has a rounded corner and a little drop shadow. so I had to use a solid background.
- MACAS00
No no, you got it all wrong, it's scaling a fish!
- unfittoprint0
you could use only the swf [without tables], and with the help of Actionscript, center/move the content movieclip.
something like this:
http://newstoday.com/docs/showco…
- jevad0
got it working unfit - thankyou!
- unfittoprint0
oops, I was replying to another thread...
btw, glad to hear that.