How is this resizing browser trick for flash done?

Hi experts! Please take a look at http://www.triworks.net/triworks2007_eng/default.htm . You will notice that all the graphics are in its place and the background graphic resizes when you resize your browser to any size. Can someone explain how this is done or provide a sample script if there are any? Thanks!!
LVL 2
funhyun1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RoonaanCommented:
Hi,

You can add a listener to the stage like so:

var myScreenManager = new Object();
myScreenManager.onResize = function() {
  trace("The screen resolution is currently " + Stage.width + " x " + Stage.height);
}

Then have:

Stage.addListener(myScreenManager).

You then also have to set the scaling mode to noscale to not have the clips on your stage scale when the swf resizes.

-r-
0
funhyun1Author Commented:
Roonan,
Wow, you just won the prize for the quickest reply!!! Just for that I should just give you the points!! ;)
So I can I can really learn this technique better, do you have or know a resource of a fla file that I can tinker with? I am just not sure where to place these codes. Thanks!
0
RoonaanCommented:
You can read this tiny article on moock's blog: http://moock.org/asdg/technotes/relayout/
It has some example code also.

-r-
0
RoonaanCommented:
In general the idea is to call this code as soon as possible, like in the actions for the first frame of your movie.

For testing from the Flash environment you would have to add first two lines also:

Stage.align = "T"
Stage.scaleMode = "noscale"

var myScreenManager = new Object();
myScreenManager.onResize = function() {
  trace("The screen resolution is currently " + Stage.width + " x " + Stage.height);
}

Stage.addListener(myScreenManager);

-r-
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
funhyun1Author Commented:
Fantastic. Thanks Roonan. :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.