Opening an HTML popup from Flash, not as tab

Hi
I need to open an HTML popup from Flash (using ActionScript in
Flex 4).
Thus far I found a solution, and it does work in Safari - a new
and separate HTML window is popped up (with a new web page).
private function popUpTheHtmlEditor():void {
  var url:String = "http://www.adobe.com";
  var request:URLRequest = new URLRequest(url);
  try {
    navigateToURL(request, '_blank');
  } catch (e:Error) {
    trace("Error occurred!");
But in (my) Firefox (with my settings), when I click on the Flash
(Flex) button, the page is being opened in a new tab.
I need a solution which pops up the HTML page in a new/separate
window, as far as possible regardless of the browser (and browser
settings).
I found an example where a popup is opened from HTML, and it opens a
separate window (a real popup) in my Firefox:
http://www.gtalbot.org/FirefoxSection/Popup/PopupAndFirefox.html
-> "Open a requested popup"
The JavaScript code seems to be:
  OpenRequestedPopup(this.href, this.target); return false;
with this function def:
  function OpenRequestedPopup(strUrl, strTarget)
    if (WindowObjectReferenceOfRequestedPopup == null || WindowObjectReferenceOfRequestedPopup.closed)
    WindowObjectReferenceOfRequestedPopup = window.open(strUrl, strTarget, "top=" + windowTop + ",left=" + windowLeft + ",width=" + windowWidth + ",height=" + windowHeight + ",menubar,toolbar,location,resizable,scrollbars,status");
    else
    if(WindowObjectReferenceOfRequestedPopup.focus)
      WindowObjectReferenceOfRequestedPopup.focus();
How could I call such code from ActionScript? Should this work through
ExternalInterface? I couldn't even get this to work:
  ExternalInterface.call('alert', 'foo');
Should I use swfobject.js for embedding the .swf in the HTML wrapper?
Any other ideas?
The two files are pasted below.
Here's the compiler command I'm using:
  mxmlc -output button.swf -target-player 10.0.0 flash_to_editor.mxml
I'm running the examples locally (as files, not over http). Would it
help to place the files on a server?
Tobi
<?xml version="1.0" encoding="UTF-8"?>
<mx:Application
  xmlns:fx="http://ns.adobe.com/mxml/2009"
  xmlns:s="library://ns.adobe.com/flex/spark"
  xmlns:mx="library://ns.adobe.com/flex/mx"
  horizontalAlign="center" verticalAlign="middle">
  <fx:Script>
    <![CDATA[
import mx.controls.Alert;
import flash.external.ExternalInterface;
import flash.net.URLRequest;
// This 'http://www.adobe.com' is just an example URL.
// Works but opens tab in FF (not a separate window):
private function popUpTheHtmlEditor():void {
  var url:String = "http://www.adobe.com";
  var request:URLRequest = new URLRequest(url);
  try {
    navigateToURL(request, '_blank');
  } catch (e:Error) {
    trace("Error occurred!");
// Doesn't work:
// var url:URLRequest = new URLRequest("javascript:alert('foo'); void(0);");
// navigateToURL(url, "_self");
// How to get this to work?
private function popUpTheHtmlEditor():void {
  ExternalInterface.call('alert', 'foo');
// How to get this to work?
private function popUpTheHtmlEditor():void {
  ExternalInterface.call('launch','http://www.adobe.com');
  // Or
  // ExternalInterface.call("window.open", "http://www.adobe.com", "win", "height=200,width=300,toolbar=no,scrollbars=yes");
// Perhaps it's necessary to try different approaches:
// (As soon as I get two approaches to work.)
private function popUpTheHtmlEditor():void {
  var s:String;
  if (ExternalInterface.available) {
    // Necessary? Safe?:
    // Security.allowDomain('*');
    s = ExternalInterface.call('launch','http://www.adobe.com');
  } else {
     // TODO: Then try URLRequest?
     s = "Wrapper not available";
  Alert.show(s);
    ]]>
  </fx:Script>
  <s:Panel title="One way to open the HTML editor"
  width="75%" height="75%">
    <s:Button id="button" label="Open the HTML editor"
    click="this.popUpTheHtmlEditor();"
    horizontalCenter="0" verticalCenter="0"/>
  </s:Panel>
</mx:Application>
<html
  xmlns="http://www.w3.org/1999/xhtml"
  xml:lang="en" lang="en">
  <head>
    <title>html_around_swf.html</title>
    <script type="text/javascript">
function launch(url) {
  alert(url);
  //  OpenWin = this.open(url, "FOO", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=400,height=200");
    </script>
  </head>
  <body>
    <object id="button" name="button" width="550" height="400"
    classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
      <param name="movie" value="button.swf" />
      <param name="allowScriptAccess" value="always" />
      <embed id="foo" name="button" src="button.swf" width="550" height="400"></embed>
    </object>
  </body>
</html>

Hi, 
Here's a solution.
1. Make ExternalInterface work when files are loaded as local files: 
Go to
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.htm l 
In tab Global Security Settings: Edit Locations -> Add Location ->
browse to the .swf file, add it. Make sure it's in the list (under the
Edit Locations drop down, with a green check mark.) 
Now open the HTML wrapper in a browser (eg Firefox). 
Now this works (ActionScript): 
private function popUpTheHtmlEditor():void {
  ExternalInterface.call('alert', 'foo');
On Windows: perhaps:
http://techjig.blogspot.com/2008/03/flash-global-security-settings-windows.html
"In order for external interface functions to be called, you must also
specify the folder/file where the swf file is located." 
The above setup isn't necessary when the files are on a server. 
Also see: 
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/External Interface.html#call()
""ExternalInterface" "
"call() method" 
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7ea6.html
"About ExternalInterface API security in Flex" 
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf626ae-7fe8.html#WS2d b454920e96a9e51e63e3d11c0bf69084-7f31
"Using the ExternalInterface API to access JavaScript" 
2. Open a real popup: Example: 
ActionScript: 
private function popUpSomething():void {
  var editorPathOrUrl:String =
    'wrapper.html';
  var windowName:String =
    "SomeNameSeeDocs";
  var windowFeatures:String =
    "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,width=500,height=700";
  ExternalInterface.call(
    'launch',editorPathOrUrl,windowName,windowFeatures
JavaScript: 
function launch(editorPathOrUrl,windowName,windowFeatures) {
  windowRef = window.open(
    editorPathOrUrl,windowName,windowFeatures
Works in all browser I tested except Opera. 
Tobi

Similar Messages

  • Problem open new html page from flash

    Hello,
    in IE7 and IE8 block popup lock my external link(page html)
    I use GetUrl(url,"_blank") but not it works
    Why?
    i use flash cs4
    With firefox it work

    thank you for response,
    i have used correct command but not it works.
    It Works, in my popup setting are setting "CUSTOM" not MEDIUM
    thank you

  • When i open any .HTML file from my computer it is not opening in firefox. Only a blank New Window Opens. Facing this problem since the firefox has updated.

    Whenever i try to open any HTML file from my computer, it opens a new firefox window which is blank. Facing this problem after the new update. please fix this problem

    I found that after Firefox v29, a LOT of my settings and<BR>
    add-ons were changed / reset. Try this;
    '''''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]'''''
    <BR>While you are in safe mode;<BR>
    '''''Firefox Options > Advanced > General'''''.<BR>
    Look for and turn off '''Use Hardware Acceleration'''.<BR>
    Then check ALL of your settings. Browser and add-ons. Then restart.

  • Open an *.html page from a vi

    Hi,
    I don't know how to open an .html file from a boolean bouton.
    someone could help me ?
    thanks

    tst wrote:
    But the HTML file on the RIO (if it's anything like remote front panels on the PC) is only a "pointer" to the VI. It is only used so that the browser will have a place to start. The PC has nothing actually running on it and the RIO is not displaying the web page.
    Here is the basic text from a sample file which tells the web browser to connect to a running VI.
    http://www.ni.com/webappdemos/lv">>
    You can see that it's only a few lines telling the browser to connect to the VI. I think that to use the link you will either need an LV program running on the computer or you will need to write your own browser for the RIO (not a recommended solution).
    Is all right, I know that the html file make only a connection to the VI, but the the web page file are on the cRIO.So I don't understand because you think that the browser must start from the cRIO. If I actually can visualize an html file, that is on the cRIO, and the browser are running on my pc, why a link from the VI (as www.html.it) must open a browser on the cRIO and not on client PC?

  • Opening a HTML page from a Navigation link

    Hi All,
           I have a requirement of adding a new link at the navigation bar of WebClient. This link will open a static html page with some contents. I have created the page required for it. But I don't know how the link will be created at Navigation bar and how to open the html page from it. I am using the SAP CRM 5.0 and I want to add the link at Default profile.
      Please help.
    Thanks
    Indranil Datta

    Hi Sujit,
        Thanks for your help. I have created a new navigation bar entity and added that in a customized profile. I have also mentioned the page name and path for that link from tran SPRO. I found that link after logging into IC WebClient. But that link is not connected with the required page. If I click on the link page, it get refreshed but without any change.
    Thanks,
    Indranil Datta.

  • How to Call HTML Layers from Flash?

    how to Call HTML Layers from Flash? i need a help on example
    or script.

    What do you mean html layers? You can call JavaScript on the
    page using the
    ExternalInterface class. There's examples in Help if you look
    up the EI
    class, and it's call method.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Opening help html documents from 10g form

    We are converting our 6i forms to 10g. I am trying to open my help html documents from the 10g forms. We have modified the httpd.conf file setting the DocumentRoot "/oracle/apps/aces/help". This is the path where my html documents reside. From the 10g forms I am using web.show_document to open the html documents. I am getting a Page not Found error. Is there somewhere else the help path needs to be set?
    Thanks!!
    Shellie Bricker

    The way i know is, putting some AliasMatch in the conf-file of Apache like
    AliasMatch ^/help/(..*) "C:\help/$1"And then use WEB.SHOW_DOCUMENT with this virtual path
    WEB.SHOW_DOCUMENT('//help/helpfile.html', '_blank');

  • Open a html page from an applet

    Hi,
    I would like to open, from an applet, an HTML page in a new window with a specific width an eight.
    Who can help me ?

    Here is an example of applet to javascript with liveconnect:
    http://www.narhari.com/java/applet2javascript/
    You can use the send(String) method from the sample applet to send something like:
    window.open('xyz.html','myPopup','width=200,height=200');in order to open a window with specific dimensions
    of course you can also build HTML in your applet and use send() + some javascript to render it.

  • Open an HTML file from a SAP Report

    Hi all!
    I would like to open an HTML file, that`s in a local directory of my PC, from a SAP Report.
    It is an alv list, where I have added a pushbotton. And I would like to code the utility of open a local html file, when someone push it.
    Anybody knows if it is possible?
    Thx

    Here is some sample code.
    report zrich_0002.
    call method cl_gui_frontend_services=>execute
      EXPORTING
        DOCUMENT               = 'C:test.html'
    *    APPLICATION            =
    *    PARAMETER              =
    *    DEFAULT_DIRECTORY      =
    *    MAXIMIZED              =
    *    MINIMIZED              =
    *    SYNCHRONOUS            =
    *  EXCEPTIONS
    *    CNTL_ERROR             = 1
    *    ERROR_NO_GUI           = 2
    *    BAD_PARAMETER          = 3
    *    FILE_NOT_FOUND         = 4
    *    PATH_NOT_FOUND         = 5
    *    FILE_EXTENSION_UNKNOWN = 6
    *    ERROR_EXECUTE_FAILED   = 7
    *    others                 = 8
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Please remember to award points accordingly and mark this post as solved when you problem is solved.  Thanks.
    Also, Welcome to SDN!!
    Regards,
    Rich Heilman

  • Help Needed in opening a HTML File from swing application

    Hi,
    I am opening a HTML file in Internet Explorer from my swing application.
    I am using the code given below
    private final static String WIN_FLAG = "url.dll,FileProtocolHandler";
    private final static String WIN_PATH = "rundll32";
    String cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
    // url is HTML file Path
    Process p = Runtime.getRuntime().exec( cmd );
    The HTML file is opening up,but it always opens behind the swing application,that makes me every time to maximize the HTML file after it being opened up.
    I want to open it in front of the Swing Application.
    Any Help Please ?
    - Manikandan

    Check your Application's JFrame properties (may be ur Frame is set to be in top position ,always),and also check running your application in some other OS.

  • Open local html document in flash

    I've been using the getURL command to open documents on a
    remote server. I need to be able to open a local document on a
    local intranet. Is the a command to open a local html file on a
    local or networked drive?

    Yes, you can open an HTML file in an in-app browser by adding the HTML file to the HTMLResources.zip. Create a button with a Go To URL action that looks something like this:
    HTMLResources/HTML_Local/index.html
    Make sure that you create your HTMLResources.zip file properly and upload it to the folder. You can test this in the Adobe Content Viewer on either the iPad or the Desktop as long as you preview the folio (not the article or layout).
    Basically, you use the same technique to link to the HTML file that you use to link to PDF files. For details, see the DPS Tips app > Advanced Overlays > Linking to PDF Files.

  • Navigate to HTML anchor from flash menu

    Hi,
    I would like to navigate to an html anchor from a flash menu.
    I use navigateToURL(“#anchorName”,
    “_self”). It work fine in IE 7, Firefox 2 and 3 but in
    safari the page reload. How can I prevent safari from reloading the
    page ?
    Thank you !

    I have solved the problem by using the externalInterface and
    a javascript function with window.location.hash.

  • Interacting with html documents from flash

    Hi,
    I'm a newbie in actionscript. I created a world map in flash. The map has regions (Europe, North America, Latin America, etc.). The regions on the map are defined as buttons.
    The final flash map will be embedded in an html document (map.html). The idea is that when you click for example the "Europe" button on the flash movie, this will open an html document called Europe.html and will show it underneath the map flash (inside map.html).
    The "Europe.html" for example contains a list of countries.
    In this mission I have 2 problems:
    1.       What script I have to attach to every region button on the flash map so it will call the right html file into the div on the map.html?
    2.       What script do I have to put inside the html document?
    Any help will be much appreciated. thank you
    Arie M.

    assign your button an instance name (in the properties panel after selecting your button) and use that name in the actions panel:
    yourbutton.addEventListener(MouseEvent.CLICK,f);
    function f(e:MouseEvent):void{
    navigateToURL(new URLRequest("map.html"),"youriframe")

  • Dreamweaver cc 2014.1 will not open the html files from my business catalyst site

    I just imported my business catalyst site (originally built with Muse) into dreamweaver.  the whole site downloaded as expected and dreamweaver maintains that the 2 folders have the same files.  When I click to open any file in Dreamweaver it appears to open and then close the file immediately giving no indication of a problem. 
    Anyone come across this and or have any idea what could be happening?  I can open these files in Text Wrangler.
    I have followed the steps of deleting preferences etc that I have come across in my search today.  None of those helped. 
    Files from other sites seem to be opening fine.
    Thank you.

    The only files I am encountering this issue with are the ones I downloaded from BC into a brand new folder.  Further, any new files that I create in Dreamweaver and then save to the local root folder of the site I downloaded from BC will no longer open after I close them.  I can open all of the files I downloaded from BC in text wrangler with no problem.  I have about 10 other sites I am having no issues with what so ever.
    I am considering this an isolated issue between Dreamweaver and the folder that I imported my BC site to as I have never had any other issue with using Dreamweaver. 
    But to answer your questions:
    1.  no
    2.  no issue
    3.  yes, no issue.
    4.  yes.  all of them.
    5.  not doing this one. 

  • I can't open a HTML file with flash linked

    I have Flash CS3.  I have created a flash file.  If I click on the SWF file I have no problems opening it.  It plays.  It looks nice.  I'm the man.
    However, now when I try to publish it, the HTML file will not work.  It says "windows cannot find this file, please ensure you have typed the location correctly".
    I am double clicking directly on the file and not typing anything, in fact I was considering checking on Ebay to see if I could upgrade my PC to have eyes.
    The feature has worked previously, which leads me to the conclusion that something else has changed.  I have tried using the publish setting, I have also tried using Dreamweaver to embed the file, and have also tried manually inserting the necessary code after seeing some on a website.
    All of these things produce the same result, windows cannot (or will not) find the necessary file.
    It's an odd one, and very frustrating, can anyone help me at all?
    Cheers in advance,
    Eoin

    Nope this doesn't work.  I wasn't using the default names previously but I can't see that it should make a difference, although Flash can be quirky.
    I tried putting them in a new location to no avail.
    Attached is a screenshot of the error message.

Maybe you are looking for