Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Failed code to open a pop-up with AS1 <edited by mod - kglad>

Explorer ,
Aug 16, 2013 Aug 16, 2013

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>

TOPICS
ActionScript
2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 16, 2013 Aug 16, 2013

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);

Translate
Community Expert ,
Aug 16, 2013 Aug 16, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 16, 2013 Aug 16, 2013

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?.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2013 Aug 16, 2013

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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 16, 2013 Aug 16, 2013

How Can I import the externalinterface class?, I have the code in a button?, Is in it or I must put in other place?.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2013 Aug 16, 2013

attached to frame:

import flash.external.ExternalInterface;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 16, 2013 Aug 16, 2013

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?.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2013 Aug 16, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 16, 2013 Aug 16, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 16, 2013 Aug 16, 2013

And in the buttons?, May I have the code?. I must called it btn1?,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2013 Aug 16, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 16, 2013 Aug 16, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 16, 2013 Aug 16, 2013

I think that something in javascript would solve the problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2013 Aug 16, 2013

in what browser are you seeing a problem?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 16, 2013 Aug 16, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2013 Aug 17, 2013

the code i suggested works for me using firefox in windows.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 17, 2013 Aug 17, 2013

Thank you very much kglad, again with your help I did it .

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2013 Aug 17, 2013
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines