Hello.
I'm trying to create a movie that adapts to fit any size screen, well width
wise anyway. At the moment I can't seem to get the Resize event to fire. It
does it once when the movie first loads in and thats it. Once the move has
loaded you can resize the browser window and nothing happens. Before I got
carried away my aim was simply move a movie clip (instance called 'rightEnd' on
the _root) left or right depending on the screen width.
At first I tried this (as in the help files), on the first frame of the movie:
Stage.align = "L";
var SWFwidth = Stage.width;
var SWFheight = Stage.height;
myListener = new Object();
myListener.onResize = function() {_root.SWFwidth = Stage.width;
_root.rightEnd._x = _root.SWFwidth-80;}
Stage.scaleMode = "noScale";
Stage.addListener(myListener);
But nothing happened, even on the first load, so I thought that perhaps I
should refer to a seperate function so I tried...
Stage.align = "L";
var SWFwidth = Stage.width;
var SWFheight = Stage.height;
function reFit(){
_root.SWFwidth = Stage.width;
_root.rightEnd._x = _root.SWFwidth-80;
}
myListener = new Object();
myListener.onResize = reFit();
Stage.addListener(myListener);
Now this got some response in the fact the movie clip (rightEnd) moved once.
Anybody any ideas as where I'm tripping up? Any help would be greatly
appreciated.
Many thanks for your time.
Meeesta.