Detecting screen size - not working in my mobile device

Hello Guys,

Actually I got the below code from net to detect the portrait and landscape screen. When I checked the same in mobile device it didn’t work properly. I am using O2 Autom device.

Can you please let me know why is it so…!!! or Do I need to add anything more…?

Code:

stop();

fscommand2(“FullScreen”, true);

/* Set scaleMode to “noScale” setting: the SWF will not be scaled
when the size of the screen device changes*/
Stage.scaleMode = “noScale”;

//Set the current alignment of the Flash movie to “Top Left”
Stage.align = “TL”;

// Create a new movie Clip
this.createEmptyMovieClip(“container”,this.getNextHighestDepth());
container._x = 0;
container._y = 0;

//Detect the screen size and load the correct file
if (Stage.width == 240) {
container.loadMovie(“myApp_portrait.swf”);
} else {
container.loadMovie(“myApp_landscape.swf”);
}