-
pop up window in the screen CENTER
Hi,
How to add screenX and screenY in below actionscript to make the pop up window in the screen CENTER.
function myFunction() {
getURL("javascript:NewWindow=window.open('URL','ne wWin','width=350,height=300,left=0,top=0,toolbar=n o,location=no,scrollbars=no,status=no,resizable=no ,fullscreen=no');NewWindow.focus();void(0);")
}
-
FK'n_dog
Code:
openLink = function(param,name,w,h,a,b,c,d,e,f,g){
sUrl = param;
resx = System.capabilities.screenResolutionX;
resy = System.capabilities.screenResolutionY;
lft = resx/2 - w/2;
tp = resy/2 - 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);");
};
popUpBtn.onPress = function(){
openLink("portfolio.html","portfolio",300,200,"no","no","no","yes","no","no","no");
};
-
thank dog, i download the file "geturl" to read it, but my script is already set, can you teach me mix below:
var my_lv = new LoadVars();
my_lv.onLoad = function() {
trace(this.myLink);
my_link.htmlText = this.myLink;
};
my_lv.load("link.txt");
function myFunction() {
getURL("javascript:NewWindow=window.open('http://hk.movies.yahoo.com','newWin','width=350,height=30 0,left=0,top=0,toolbar=no,location=no,scrollbars=n o,status=no,resizable=no,fullscreen=no');NewWindow .focus(); void(0);")
}
______________________
the link.txt is " &myLink=<a href="asfunction:myFunction">yahoo movies</a> "
______________________
the "getURL" is link "link.txt", that inside is movies link list, that mean no any "on release/press" something action in the flash file
-
Moderator
Nice Script doggy !!
-
FK'n_dog
Code:
var my_lv = new LoadVars();
my_lv.onLoad = function() {
trace(this.myLink);
my_link.htmlText = this.myLink;
};
my_lv.load("link.txt");
function myFunction() {
sUrl = "http://hk.movies.yahoo.com";
name = "newWin";
w=350; h= 300;
a ="no"; b ="no"; c ="no"; d ="no"; e ="no"; f ="no"; g ="no";
resx = System.capabilities.screenResolutionX;
resy = System.capabilities.screenResolutionY;
lft = resx/2 - w/2;
tp = resy/2 - 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);");
};
this hack will work
to make it re-usable, change the text file to -
Code:
&myLink=<a href="asfunction:myFunction,http://hk.movies.yahoo.com">yahoo movies</a>
and go to the function with -
Code:
function myFunction(param) {
sUrl = param;
...snip
...snip
};
-
Dog, I'm having some trouble with your script.
I uploaded my file. do you know what I did wrong?
Thanks
http://www.mouseexplorer.com/test/popwindow.zip
-
FK'n_dog
what trouble specifically ??
syntax errors ??
failing to open the window when testing offline ??
(you must upload the html and swf to a server and test online)
-
sorry for not giving enough detail.
failing to open the window when testing offline
-
FK'n_dog
failing to open the window when testing offline
caused by new security rules for the Flash Player
you must upload and test online
-
Thanks for letting me know that.
Does the script have to be placed on the button or the keyframe?
Does this get placed on the instance of the button? "popUpBtn"
Can you explain "param,name,w,h,a,b,c,d,e,f,g"
Thank you for your help.
-
FK'n_dog
in my post - 04-01-2006, 10:00 AM
popUpBtn is the instance name of a button
param,name,w,h,a,b,c,d,e,f,g - these are the parameters passed to the function named openLink
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|