this is the code for action scipt 2 in flash for a tutorial that we were doing in class. the code is designed to
to keep a website or game proportionate to the screen thats being used, so the initial size of the stage could be really smalll, but can be extended to fita screen pf any size. this isnt a tutorial on how to doit and is unfinished, but would like to finish it at some point.
code used:
Stage.align = "TL";
Stage.scaleMode = "noScale";
sizeListener = new Object();
sizeListener.onResize = function(){
fullsize();
};
Stage.addListener(sizeListener);
_global.fullsize = function(){
navBar._width = Stage.width
box1._x = stage.width/2 - box1._width/2
box1._x = stage.width/2 - box1._height/2
bg._width = stage.width
bg._height = stage.height
};
fullsize();
btn.onPress = function(){
box1.gotoAndStop(); (1)
}
screen grab of the initial result (dosnt look right as i havent got around to finish it yet.
some of the other objects in the screen shot are behind the background image. i might be able to remedy this for future flash projects.

No comments:
Post a Comment