Anyway, I’m new to Flash, so I only have half a clue of what I’m doing. I am trying to make a FULL BROWSER Flash layout for a guild I am in in a video game. Yes I’m only 15 so I game pretty hardcore haha.
I use the resolution 1280 x 1024. However, I am having much trouble making it look right in all resolutions. The only thing that looks fine in all resolutions is the background haha. Here is what my code looks like to adjust the position and size of the images I used.
// ***Stage aligned top left
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
stop ();
//position
box._y = Stage.height/5;
box._x = (Stage.width + 100)/20;
nav._y = Stage.height - 60;
nav._x = (Stage.width + 1525 )/20;
home_btn._y = Stage.height - 380;
home_btn._x = 0;
about_btn._y = Stage.height - 380;
about_btn._x = +111;
roster_btn._y = Stage.height - 380;
roster_btn._x = +220.9;
loader_mc._y = Stage.height /8
loader_mc._x = Stage.width /30
loader_mc2._y = Stage.height /2
loader_mc2._x = Stage.width /2.25
myStageListener = Object();
myStageListener.onResize = function ()
{
//backgroundsize
bg._width = Stage.width;
bg._height = Stage.height+90;
//backgroundsize
//position
box._y = Stage.height/5;
box._x = (Stage.width + 100)/20;
nav._y = Stage.height - 60;
nav._x = (Stage.width + 1525 )/20;
home_btn._y = Stage.height - 380;
home_btn._x = 0;
about_btn._y = Stage.height - 380;
about_btn._x = +111;
roster_btn._y = Stage.height - 380;
roster_btn._x = +220.9;
loader_mc._y = Stage.height /8
loader_mc._x = Stage.width /30
loader_mc2._y = Stage.height /2
loader_mc2._x = Stage.width /2.25
};
Stage.addListener(myStageListener);
myStageListener.onResize();
//size
//button actions
home_btn.onRollOver = function () {
home_btn.gotoAndPlay("_over");
}
home_btn.onRollOut = function () {
home_btn.gotoAndPlay("_out");
}
home_btn.onRelease = function () {
loader_mc.loadMovie("home.swf");
home_btn.gotoAndPlay("_out");
loader_mc2.unloadMovie("aboutvideo.swf");
}
about_btn.onRollOver = function () {
about_btn.gotoAndPlay("_over");
}
about_btn.onRollOut = function () {
about_btn.gotoAndPlay("_out");
}
about_btn.onRelease = function () {
loader_mc.loadMovie("about.swf");
about_btn.gotoAndPlay("_out");
loader_mc2.loadMovie("aboutvideo.swf");
}
roster_btn.onRollOver = function () {
roster_btn.gotoAndPlay("_over");
}
roster_btn.onRollOut = function () {
roster_btn.gotoAndPlay("_out");
}
roster_btn.onRelease = function () {
loader_mc.loadMovie("roster.swf");
roster_btn.gotoAndPlay("_out");
loader_mc2.unloadMovie("aboutvideo.swf");
}
**Alright so example, I want to get that home button (home_btn) and loadMovie loader (loader_mc) loaded the same size in proportion to every resolution. How would I go about doing this? **
I know I would use:
home_btn._height = Stage.height ? n ;
home_btn._width = Stage.height ? n;
loader_mc._height = Stage.height ? n ;
loader_mc._width = Stage.height ? n;
But how would I find the right values for the ? and n? Right now, I’m just plugging in random numbers and hoping it gets in the right spot and size but there has to be another solution for this isn’t there? I’ll give you some dimensions.
Stage: 1600 x 1200
My resolution: 1280 x 1024
Button: 111 x 25
Stage of external .swf being loaded: 430 x 330
I think that’s all you need. Is there anyway I can use math to figure out what values to insert in
home_btn._height = Stage.height ? n ;
home_btn._width = Stage.height ? n;
loader_mc._height = Stage.height ? n ;
loader_mc._width = Stage.height ? n;
Someone please help. This is the only thing that is stopping me from continuing the layout. The positions are now fine, it’s the size of the movie clips and how they get in the way of each other that is giving me problems. Thanks in advance.