Copy link to clipboard
Copied
Hi,
I have the following code:
on (release) {
h = 200;// height of the pop-up
w = 160;// width of the pop-up
getURL("javascript:NewWindow=window.open('../../grafico/sudespacho/mnprogram2.html','pop2','width=160,height=200, toolbar=No,location= No,scrollbars=No,status=No,resizable=No,fullscreen =No,top='+0+', left='+720+'"+"');void(0);");
}
, and in Safari 5.0.6 it opens fine, however in other browsers the pop-up has some blank space in the height located at the bottom. Is possible to add a javascript or AS2 to resize the window?, Please, Can you help me to solve that incidence?.
Regards.
<moved from as3 forum by mod - kglad>
import the externalinterface class and use:
var s:String = 'window.open("http://www.adobe.com", "winName","height=220, width=500, scrollbars=no, top=90, left=222")';
ExternalInterface.call(s);
Copy link to clipboard
Copied
you're posting in the wrong forum and your title implies you're using as3.
your code is as2 and yes, you can use javascript to size your popup window. by assigning the windows width and height.
Copy link to clipboard
Copied
Sorry for have posted in the wrong forum. However the error remains. Could you help me with some javascript to resize the window in different browsers?.
Copy link to clipboard
Copied
import the externalinterface class and use:
var s:String = 'window.open("http://www.adobe.com", "winName","height=220, width=500, scrollbars=no, top=90, left=222")';
ExternalInterface.call(s);
Copy link to clipboard
Copied
How Can I import the externalinterface class?, I have the code in a button?, Is in it or I must put in other place?.
Copy link to clipboard
Copied
attached to frame:
import flash.external.ExternalInterface;
Copy link to clipboard
Copied
So the result of the code changing some lines is:
stop();
import flash.external.ExternalInterface;
var s:String = 'window.open("http://www.adobe.com", "winName","height=220, width=500, scrollbars=no, top=90, left=222")';
ExternalInterface.call(s);
in the frame.
And in the button?, What happens if I have five pop-ups to open?.
Copy link to clipboard
Copied
use a different string to code your 5 button handlers.
and while you can attach code to your buttons, you really should never attach code to objects.
import flash.external.ExternalInterface;
var s:String;
btn1.onRelease=function(){
s = 'window.open("http://www.adobe.com", "winName1","height=220, width=500, scrollbars=no, top=90, left=222")';
ExternalInterface.call(s);
}
btn2.onRelease=function(){
s = 'window.open("http://www.kglad.com", "winName2","height=520, width=400, scrollbars=no, top=190, left=22")';
ExternalInterface.call(s);
}
etc
Copy link to clipboard
Copied
You can check the website in:
luscoefusco13.es
and go to "II/grafico" (second of the right menu) and then go to "g1" banners corporativos and finally MNprogram 2.
Copy link to clipboard
Copied
And in the buttons?, May I have the code?. I must called it btn1?,
Copy link to clipboard
Copied
you can use any legal names for your buttons that you want. just make sure those names match in the code and in the properties panel.
Copy link to clipboard
Copied
I did it and I have the same problem the height is not the requeted. Please...Could you help me?. You can check them on-line.
Copy link to clipboard
Copied
I think that something in javascript would solve the problem.
Copy link to clipboard
Copied
in what browser are you seeing a problem?
Copy link to clipboard
Copied
Hi kglad,
first of all many thanks for the support.
I attach this code as a script in the head of the htm file that contains the swf and it functions well:
<script>window.resizeTo(160,200);</script>
I use Safari but is an older version (5.0.6), due that I have a Mac without Intel, and I see in it the website fine. However in new versions of the Safari or other browsers (Chrome, Firefox, Opera, etc.)I can not see the website as I want.
I go to bed.
Talk later.
Many thanks for all.
Copy link to clipboard
Copied
the code i suggested works for me using firefox in windows.
Copy link to clipboard
Copied
Thank you very much kglad, again with your help I did it .
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now