| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Sep 2002
Posts: 4
|
I need help with using these two
fas.Win.GetWH fas.Shell.GetScreenWH I'm trying to set my window at the absolute bottom of the screen in the middle. I tried just using fscommand("fas.win.pos","middle,bottom"); but that puts it too high on the bottom. So I'm trying to get the total width then find half then get total movie width ang get half of that. then find the position along x by subtracting the two results. The Y would be found by taking the total height less the movie height. however, I cannot get access to the vars returned from win.getwh and getscreenwh. Here's what i'm trying to do exactly : //get and set window position fscommand("fas.Shell.GetScreenWH","totalwidth,tota lheight"); fscommand ("fas.Win.GetWH", "winwidth,winheight"); dockX = (totalwidth / 2)- (winwidth / 2); dockY = totalheight - winheight; //dockX = 500; //used to test that win.setxy works //dockY = 500; //same as above dockXY = dockX add "," add dockY; fscommand("fas.Win.SetXY",dockXY); So it works when i put in valuse for dockX and dockY, but not when I work off the numbers returned from getscreenwh or getwh. Thanks ![]() |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Apr 2002
Location: Taipei, Taiwan
Posts: 147
|
Whenever to retrieve system information to variable, pls wait a few frames untill the information to be successfully retrieved.
Example: Frame N: //get and set window position fscommand("fas.Shell.GetScreenWH","totalwidth,tota lheight"); fscommand ("fas.Win.GetWH", "winwidth,winheight"); Frame N+4: dockX = (totalwidth / 2)- (winwidth / 2); dockY = totalheight - winheight; //dockX = 500; //used to test that win.setxy works //dockY = 500; //same as above dockXY = dockX add "," add dockY; fscommand("fas.Win.SetXY",dockXY); Or you should make a loop to check if the variables are retrieved. |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Sep 2002
Posts: 4
|
I tried this, but it just runs forever and hogs the cpu.
totalwidth=0; totalheight=0; winwidth=0; winheight=0; while(totalwidth==0||totalheight==0||winwidth==0|| winheight==0){ fscommand("fas.Shell.GetScreenWH","totalwidth,tota lheight"); fscommand ("fas.Win.GetWH", "winwidth,winheight"); } dockX = (totalwidth - winwidth)/2; dockY = totalheight-winheight; //dockX = 327; //used to test that win.setxy works //dockY = 849; //same as above dockXY = dockX add "," add dockY; fscommand("fas.Win.SetXY",dockXY); //end window pos |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Apr 2002
Location: Taipei, Taiwan
Posts: 147
|
Don't use WHILE or FOR loop in a single frame to pause or wait:
http://www.macromedia.com/support/fl.../f5_pauser.htm |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|