Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How is this resizing browser trick for flash done?

Posted on 2006-04-01
5
Medium Priority
?
167 Views
Last Modified: 2008-03-10
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!!
0
Comment
Question by:funhyun1
  • 3
  • 2
5 Comments
 
LVL 49

Expert Comment

by:Roonaan
ID: 16348825
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
 
LVL 2

Author Comment

by:funhyun1
ID: 16348840
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
 
LVL 49

Expert Comment

by:Roonaan
ID: 16348869
You can read this tiny article on moock's blog: http://moock.org/asdg/technotes/relayout/
It has some example code also.

-r-
0
 
LVL 49

Accepted Solution

by:
Roonaan earned 2000 total points
ID: 16348875
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
 
LVL 2

Author Comment

by:funhyun1
ID: 16348902
Fantastic. Thanks Roonan. :)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question