A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: browser position help please, as 2.0

  1. #1
    Member
    Join Date
    Mar 2009
    Posts
    34

    browser position help please, as 2.0

    Hi
    I have my flash site working ok, but want the pop up browsers that are sized to pop up in the centre of the screen, instead of the bottom! Anyone know how to fix this? I'm using the following code on buttons:

    on (release) {
    getURL("javascript:CultWear=window.open('http://www.stevedawson.org.uk/cultweargallery.html','CulWea','width=1133,height= 425,left=425,top=1133,screenX=1133,screenY=425');C ultWear.focus();void(0);");
    }


    and this is the site so far....

    http://www.stevedawson.org.uk/metaphyzicalindex.html

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    to centre your popup, use System.capabilities.screenResolutionX / screenResolutionY
    PHP Code:
    // on the main timeline
    myLink = function(param,name,w,h,a,b,c,d,e,f,g){
    sUrl "http://"+param;
    resx System.capabilities.screenResolutionX;
    resy System.capabilities.screenResolutionY;
    lft resx/w/2;
    tp resy/h/2;
    getURL("javascript:window.open('"+sUrl+"','"+name+"','width="+w+",height="+h+",top="+tp+",left="+lft+",directories="+a+",location="+b+",menubar="+c+",resizable="+d+",status="+e+",toolbar="+f+",scrollbars="+g+"');void(0);"); // be sure that the getURL code is on one line
    };

    // on the button -
    on(release){
    myLink("www.yahoo.com","yahoo",300,200,"no","no","no","yes","no","no","no");


  3. #3
    Member
    Join Date
    Mar 2009
    Posts
    34
    can u explain to me which bits are meant to be altered?

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    my code is not so much a - "alter your code using this".
    it is more a - "replace your code with this"

  5. #5
    Member
    Join Date
    Mar 2009
    Posts
    34
    ok, but i'm guessing i need to alter bits of ur code to fit. for instance

    sUrl = "http://"+param; am i supposed to alter sUrl to the name of the url i'm trying to open? or is that meant to go in the http:// bit?

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    PHP Code:
    // on the button - 
    on(release){ 
    myLink("www.stevedawson.org.uk/cultweargallery.html","CulWea",300,200,"no","no","no","yes","no","no","no"); 

    this will open a resizable 300x200 window in centre of your browser

  7. #7
    Member
    Join Date
    Mar 2009
    Posts
    34
    works brilliantly thanks!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center