Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Flashants Support Forum

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-24-2002, 01:37 AM   #1
wiseganesha
Registered User
 
wiseganesha's Avatar
 
Join Date: Sep 2002
Posts: 4
Default fas.Win.GetWH and fas.Shell.GetScreenWH

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
wiseganesha is offline   Reply With Quote
Old 09-24-2002, 11:45 AM   #2
Flashants
Moderator
 
Join Date: Apr 2002
Location: Taipei, Taiwan
Posts: 147
Default

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.
Flashants is offline   Reply With Quote
Old 09-25-2002, 05:32 AM   #3
wiseganesha
Registered User
 
wiseganesha's Avatar
 
Join Date: Sep 2002
Posts: 4
Default Still not working

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
wiseganesha is offline   Reply With Quote
Old 10-07-2002, 09:22 AM   #4
Flashants
Moderator
 
Join Date: Apr 2002
Location: Taipei, Taiwan
Posts: 147
Default

Don't use WHILE or FOR loop in a single frame to pause or wait:
http://www.macromedia.com/support/fl.../f5_pauser.htm
Flashants is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:45 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.