PDA

View Full Version : Please help :)


davordavor
04-08-2007, 02:34 PM
Hi!

I'm sorry to bother you but I have 2 questions.. If someone knows the solution it qould make my life alot easyer :)

1. How can I tell Flash that it must take the resolution of the user viewing the page and resize to optimal size...

The page was created for resolution 1280x1024... But many internet users have smaller disp. res.. So I wold like the swf file to adapt to users res.

Original:
display res. 1280x1024px ---- flash resolution 800x600px


2. I found a few tutorials on how to make a simple calendar.. But now I would like to have a calendar that takes entries and the entry field couldn't be entered without password.. Is this posible without XML or PHP??


THANX and have a nice day :)

pmnot
04-08-2007, 05:04 PM
1. you can access the resolution through system.capabilities

trace(System.capabilities.screenResolutionX);
trace(System.capabilities.screenResolutionY);


if(System.capabilities.screenResolutionY<600){ //check the vertical resolution of the screen
//rearrange/resize your stuff
}
this method checks the resolution of the monitor NOT the browser window
and if the browser has a lot of chrome or is open as only a portion of the screen the space will be much smaller

2. set the Stage.scaleMode to noScale and embed at 100%x100% size
(this sets the stage to 100% the width and height of the browser window but leaves your content unscaled

then use Stage.width
Stage.height
to set the size and placement of your content

this method checks the resolution of browser window the NOT the monitor so if a user has the window open only as a part of their screen the stage is set to the browser window size not the size of the available screen

but you can add a listener to check if the window is resized and rearrange/resize again

Stage.scaleMode = "noScale"
var myListener:Object = new Object();
myListener.onResize = function () {
trace("Stage size is now " + Stage.width + " by " + Stage.height);
//rearrange/resize your stuff
}
Stage.addListener(myListener);
// later, call Stage.removeListener(myListener)