ExternalInterface call in Javascript popup

I am incorporating a swf in a pop up window using the javascript window.open function. I am currently passing through static values for the height and the width corresponds to the height and width of the embedded swf file of the popup.  A user can click a button in the swf file, and it changes the size of the SWF to 400 x 300, at 800 x 600.  In flex, I use ExternalInterface.call("saveglobalscore",score) ("resize"); but nothing happens.  I'm a complete noob with javascript, is not how to use the ExternalInterface API?  Any ideas why it does not work?  Is there an easier way to get the same functionality to work with something else?  The JavaScript code is below, tons of thanks in advance to tide me over.

< SCRIPT TYPE = "text/javascript" >

<!--

popup function (mylink, windowname)

{

If (! window.focus) return true;

var href;

If (typeof (mylink) is 'chain')

href = mylink;

on the other

href = myLink.href;

Popup = window.open (href, windowname, 'width = 400, height = 300, scrollbars = no, resizable = 1');

Returns false;

}

function resize()
{
popup.resizeTo (800, 600);
}


->

< /script >

< body >

" < a HREF =" http://localhost/main.swf "onClick ="return popup (this, 'notes')"> "

App

< /A >

Here is the sample,

Sample.MXML


http://www.adobe.com/2006/mxml"
     layout="absolute"
     width="100%" height="100%">
     
          
     
     

Parent html


     
          Resize Demo
          
     
     
          
     

Child html (Popup.html)


     
          Resize - Popup
          
     
     
          
               
               
          
     

Tags: Flex

Similar Questions

  • ExternalInterface call the Javascript to AS2 array throwing error undefined

    I need to pass various (follow-up) IDs to a .swf.  the IDS are in a table like this =

    < script type = "text/javascript" >

    function getImpID() {}

    var medID = {impID: pvID '12345': ' 677890', exID: '654332'};

    return medID;

    };

    function thisMovie (banner) {}

    If (navigator.appName.indexOf ("Microsoft")! = - 1) {}

    Returns the window [banner]

    }

    else {}

    return the document [banner]

    }

    }

    Window.OnLoad = getImpID;

    < /script >

    For now, the AS2 I is:

    flash.external import. *;

    System.security.allowDomain (sourceDomain)

    var allID:String = ExternalInterface.call.apply ("getImpID");

    function getIDs() {}

    var impID:Number;

    var pvID:Number;

    var exID:Number;

    var id_arr:Array = allID.split(",");

    _root.id_test. Text = impID;

    }

    getIDs();

    Basically, what I need is to divide the three identifiers from the javascript so that I can add with different URL clickTags in the will.  I primarily the "undefined" error, so I'm going out on a limb here I have the AS2 does nothing now value.  More big scratcher head for me is, if I have the ID in an array in javascript (medID) how do I get them not only correctly in Flash, but separate them in their separate identity papers.

    Any suggestions would be greatly appreciated.

    Thank you!

    I forgot to answer, your tips have helped solve the puzzle =

    ActionScript:

    function idTag() {}

    getID = Object (ExternalInterface.call("saveglobalscore",score) ("getImpID"));

    getID.toString ();

    _root.id_test. Text = getID;

    }

    idTag();

    JavaScript

    has worked like a charm!

  • Problem with AS3 &amp; quot; ExternalInterface.call("saveglobalscore",score) &amp; quot; in Internet Explorer

    Hello

    Explain how the page is set up:

    I have a HTML page with 2 different movies Flash AS3.

    The first flash movie is the main entertainment and is located in the middle of the screen with a large background image defined in the body of the HTML.

    The second flash movie spans 100% width/height of the size of the screen and acts as a black fade > invisible.

    What I'm doing:

    Once the second Flash animation has gone from black to invisible it calls a JavaScript function on the HTML page to hide the div element, the second flash movie is integrate in (it's like the first flash movie displays a set of input boxes, which the user must be able to type-which will not be able to click on if there is another flash animation that just overlap the first film).

    My initial solution:

    In the second Flash movie is the following code:

    ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
    Stop();

    This will load the API needed to communicate with external entities
    to import flash.external.ExternalInterface;

    call the JavaScript function
    ExternalInterface.call("saveglobalscore",score) ('myJavaScriptFunction');
    ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////

    .. .and it works fine in Mozilla Firefox/Safari. The actionscript code successfully the JavaScript function in the HTML page and this JavaScript function simply calls (to this poster from the scene an alert() message to show that it has been called successfully).

    Problem with IE:

    But, at the time when I try this in Internet Explorer, I get an alert() message but a JavaScript error message that says:

    ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
    Code: Select all
    Line: 1
    Char: 106
    Error: 'null' is null or not an object
    Code: 0
    ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////

    As you would expect I am totally confused as to what could be the problem.

    It's really urgent because it is a living project which must be completed immediately, any help you might have would be greatly appreciated!

    Kind regards

    Select this option.

    GWD salvation,

    Who did it! :)

    I applied the attribute id = "fTrans" to the tag and IE worked well.

    I disparage me my brain one, thank you very much!

    Kind regards
    Mark

  • Flash cannot call the javascript function in the local html file

    Hello!

    Us is to develop our first application on Playbook. It is an html file including a flash file and javascript code. Everything is packed in. in the file bar, a config.xml file and has been correctly loaded into the Playbook. Everything works locally (no web access)

    Everything works well except when we use an ExternalInterface.call("saveglobalscore",score) in flash that calls a javascript function in the .html file.

    In the actionscript3, we selected the "authorized local file access" and put the 'Security.allowDomain("*) '.

    Any ideas? Thank you!

    External interface tries to access the files packaged locally is currently a known issue.  I have not really of a calendar when or if this can be resolved.  It may be in the code base of flash.

  • Call from JavaScript to AS3 bar reading

    Platform: Captivate 7

    Source: AS3 (obvious, I hope!)

    Output: Flash v10

    I make a unique version of one of the default player bars.  I'm doing the Exit button call a JavaScript function using the following code:

    var btnTipsId = 8;

    function onClicked()

    {

    to import flash.external.ExternalInterface; //Register ExternalInterface

    ExternalInterface.call("saveglobalscore",score) ("closeModule ()"); //Call JS to close Div

    / / parent.onPBCBtnClick ("exit");

    }

    As you can probably see, I don't want to Exit button to close the module with the way she normally does.  My 'closeModule()' function removes a Div layer that hosts the Captivate.  I know it works as we use it in other places.  The problem I encounter is strictly in obtaining the PlayBar to call this JavaScript instead of its function by default 'parent.onPBCBtnClick ("exit");".

    Any ideas?

    Try calling closeModule without the parentheses:

    ExternalInterface.call("saveglobalscore",score) ("closeModule");

  • Flex 3: need help with ExternalInterface.call("saveglobalscore",score)

    Hello

    I have my setting up a Flex project in my Flex Builder.

    I am going through my step by step to understand.

    In our project, we got this call:

    public function callDataOfJSMethod (): void
    {
    ExternalInterface.call("saveglobalscore",score) ("getData");
    }

    But I was not this getData anywhere, couldn't you please let me know what it could be and where I can find that?

    Thanks in advance.

    It should be a javascript method in the html wrapper.

  • ExternalInterface.call("saveglobalscore",score) on several areas?

    I use ExternalInterface.call("saveglobalscore",score) in a SWF to call a JavaScript in the html container. The swf file is located in one field other than the html container. Everything works very well if all the files are in the same root directory, but as soon as I make reference to the swf file that is located in the other domain, the call is not working! What Miss me?

    SWF file has this frame 1:
    to import flash.external.ExternalInterface;
    function clickListener(eventObj:Object):Void {}
    ExternalInterface.call("saveglobalscore",score) ("sendToResponseForm");
    }

    SWF file has this on mc as a button instance:
    {We (Press)}
    clickListener();
    }

    HTML/container file that is in the < head > tag:
    < script type = "text/javascript" >
    function sendToResponseForm() {}
    Window.Location = "my.other.html.file";
    }
    < /script >

    HTML file has this integrated:
    < object classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase =" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6, 0,29,0 ' width ="700"height ="550">" "
    "" < param name = "movie" value = " http://www.otherdomain.com/vid/my.SWFFile.swf" / >
    < param name = "quality" value = "high" / >
    "" "" < embed src = " http://www.otherdomain.com/vid/my.SWFFile.swf" quality = "high" pluginspage = " http://www.macromedia.com/go/getflashplayer ' type =" application/x-shockwave-flash"width ="700"height ="550"> < / embed >
    < / object >

    If all goes well, that's enough for you to chew. As I was saying that if swf and html are in the same domain, it works. As soon as I point to the second area of source of swf file it stops working.

    Thank you
    Demont

    Here is my error: the swf file has been very good and actually worked in IE6/IE7 but doesn't work in Firefox. The process to include the swf file in the HTML code has been vitiated. I originally published the HTML using Dreamweaver to write the in the code. Which fixes the problem, it's that I published the swf using the Flash file in a folder of the office that produced a javascript (AC_RunActiveContent.js), the swf file and HTML file. Javascript code dynamically determined Explorer who was used and which plugin player was necessary. The script loads/writes in the end the appropriate environmental content and any embed or object of the swf file is successfully. He had nothing to with Lacrosse communication area at all.

    The main challenge was last updated the HTML/Javascript Flash to use the appropriate resource, swf, which was located on a different server and move the js file in the appropriate directory, update the link in the HTML accordingly. My only concern was the more general source external javascript. But, at least I'm not concerned with the question of whether it works or not.

    Hope this helps someone.

    Demont

  • ExternalInterface.call("saveglobalscore",score) () error with Flash Player 10

    I don't know what that means. The function runs successfully in javascript, and I evaluate ExternalInterface.available...

    TypeError: Error #1009: cannot access a property or method of a null object reference.
    at flash.external::ExternalInterface$/_callIn()
    < anonymous >)
    at flash.external::ExternalInterface$/_evalJS()
    at flash.external::ExternalInterface$/call()
    at views.audio::myObject/myFunction()

    UPDATE: it was JS calling a reminder the null value.

  • Error when you try to call the Javascript function in the ActiveX Web browser

    I have a requirement to call a Javascript function in a web page that is displayed in the browser's ActiveX control.  I have the control on the front panel, and I use the Navigate method to call to the top of the appropriate page.  Based on an example, I found, I'm trying to get a reference to the HTML Document so that I can then get a reference to the Fenetreparent.  There is a method of the HTML Window object called execScript who I'm calling.  See the attached image of the code (reference close calls do not appear, but when I run it, they are there).

    I can't the node property that returns the parentWindow reference.  The error I get is the following.

    Error-2147467262 LabVIEW: (Hex 0 x 80004002) No. taken such interface supported.

    Any ideas on where to go from here?

    Hello

    I have reproduced the issue and the error you are seen and tried to understand what is the solution.

    It seems that the problem is with getting the pointer to the parentWindow.  From what I read on MSDN, it's maybe a limitation in the use of an ActiveX control in LabVIEW. It seems like Internet Explorer creates the object of the window, and so opening in one ActiveX control you free access to this top-level object.

    Here could be workaround for javascript execution in your program:

    I would like to know if it works for you and if it will work in your program.

  • Call a Javascript function in a Captivate 7 Web page

    Hello

    I try to call a javascript function in a web page to Captivate 7. The call is an output of blade event. When I saw the (F4) project, I have a prompt that displays a javascript function is called and told me to display in a web page. Of course, which is perfectly logical. However, when I go to the same project in the hml with the necessary Javascript function in page, I get nothing. The script is a simple that displays an alert.

    I made sure the SWF in question is defined in the global security settings. I know that the javascript function is correctly formatted.

    Can someone please give me an example of how to "execute Javascript" call of Captivate to a function residing in the html page please.

    Any help is appreciated.

    Don't just add the SWF file to the Flash security locations overall of confidence.  Add the entire folder containing all the files published, or better still, a level that contains all your published Captivate projects so that you never have to worry about Flash security issues again.

    Also, if it still does not work, I would try the same running JavaScript with a different event than the event output slide.  It can be a little bit reliable.

  • Call a javascript function in the Value attribute of param

    Hello

    I want to put a TLF text field in the SWF file in an HTML page. So I used flashvar, by calling a javascript function to it attribute "value" as follows.

    < param name = FlashVars value = "" + SetFlashMovieParam() + "" id = "message" / > "

    SetFlashMovieParam() is a javascript like the following function.

    function SetFlashMovieParam() {}

    document.getElementById("message").setAttribute ("value", "msgText = Start");

    }

    Even if this does not work, when I put the text value directly to the 'value' attribute, it worked.

    < param name = FlashVars value = "msgText = here % 20is % 20The % 20text" id = "message" / > "

    I think it's because calling a javascript function syntax error in the param tag. Can anyone help to call this function properly...

    Thank you.

    Normally when you have an executable code embedded in the html code you should check that article accordingly.  In the case of javascript surround you with

  • ExternalInterface.call("saveglobalscore",score)

    This does not work what is the wrong in this code.

    If I trace (urlPath) showing - null.

    var urlPath = ExternalInterface.call("window.location.href.toString");
    
    if(urlPath != "http://www.domainname.com/demo/test/welcome.swf")
    {
              trace("Yes");
              pageMsg.text = "this is html"
      
    }
    else
    {
              trace("no");
              pageMsg.text = "This is swf"
    }
    
    

    I tested this code html of the page and it works fine.  I created a test document if you want to check.  Click on the green rectangle so that the url displayed...

    http://www.nedwebs.com/Flash/welcome.html

    The swf file contains an mc button named "btn" and a textfield named "url".  The code in the swf file is as follows...

    btn.addEventListener (MouseEvent.CLICK, traceURL);

    function traceURL(evt:MouseEvent):void {}
    var urlPath = ExternalInterface.call("saveglobalscore",score) ("windowhref");
    URL. Text = urlPath;
    }

    You should test it on a server by using the html page, if you don't already have it.

  • How to call the javascript function in ADF

    I have the javascript function stored in a .js file external (try to reuse in another application). How can call the javascript function for an event of ADF faces component. I need to I am a newbie to ADF, all ideas are appreciated.

    Kind regards
    Surya

    Published by: sgodavar on Sep 24, 2010 11:44

    Include JavaScript to the jsff/jspx as page:

    Call it like:

    Type = "dblClick" / >
    Amit

  • Can LOV in report - I call a JavaScript on change?

    Hi I have a lov in a report. I want to do is call a JavaScript on the evolution of the value?

    is this possible?

    Thanks in advance

    Hello
    Just edit the column and put your onchange statement in the attributes of the element.
    Kind regards

  • ExternalInterface.call("saveglobalscore",score) () throws ScriptTimeoutError, which may not be intercepted

    Hello

    In my flex code, I invoke ExternalInterface.call("saveglobalscore",score) () to call a function in c ++. In this feature of c ++, a modal dialog box will appear. If this modal dialog box is open for a long time, a warning dialog box saying that a function has executed more than 15 seconds. I wanted to capture this error (which should be ScriptTimeoutError) to suppress this warning dialog box. But I failed.


    In the following code, flex timeout warning dialog will show, do not show my words:

    Try
    {
    ExternalInterface.call("saveglobalscore",score) ("popUpModalDialog");
    } catch(e:Error)
    {
    Alert.Show ("Please don't show dialogue timeout");
    }


    But if I change the code a bit more, flex timeout warning dialog will not appear, my words will show:

    Try
    {
    While (true) {}
    } catch(e:Error)
    {
    Alert.Show ("Please don't show dialogue timeout");
    }


    The examples show that ExternalInterface. () Call throws an error that cannot be intercepted.
    Is there a way I can suppress this warning dialog?

    Thank you!

    Hello

    In my flex code, I invoke ExternalInterface.call("saveglobalscore",score) () to call a function in c ++. In this feature of c ++, a modal dialog box will appear. If this modal dialog box is open for a long time, a warning dialog box saying that a function has executed more than 15 seconds. I wanted to capture this error (which should be ScriptTimeoutError) to suppress this warning dialog box. But I failed.

    In the following code, flex timeout warning dialog will show, do not show my words:

    Try
    {
    ExternalInterface.call("saveglobalscore",score) ("popUpModalDialog");
    } catch(e:Error)
    {
    Alert.Show ("Please don't show dialogue timeout");
    }

    But if I change the code a bit more, flex timeout warning dialog will not appear, my words will show:

    Try
    {
    While (true) {}
    } catch(e:Error)
    {
    Alert.Show ("Please don't show dialogue timeout");
    }

    The examples show that ExternalInterface. () Call throws an error that cannot be intercepted.
    Is there a way I can suppress this warning dialog?

    Thank you!

Maybe you are looking for

  • The history in the Privacy tab settings are passed from Options in Firefox 18

    After the upgrade to Firefox 18 the history settings in the privacy of the Options Panel section are no longer visible/available as they were in earlier versions. How to manage these settings in Firefox 18?

  • Is it OK to upgrade to 8.1 Windows now or not?

    Hello everyone. Last summer, I bought a HP ENVY dv6-7331sa Notebook PC with Windows 8 OS.  Not long after the release of W8.1 update I received a message warning me HP DO NOT upgrade to W8.1 I could meet some problems. Is it OK to upgrade now? Thanks

  • Can I set up a second drive C: XP on my PC

    I have a laptop HP OEM XP Home Edition on drive C: has become crowded over the years. The system is rather slow due to debris left by the programs that I have tried and discarded and who have not uninstalled as cleanly as they should. I changed the h

  • HP Pavilion G6 2323sx: Please help me - unknown device (ROOT\STORLIB\0000

    Dear Sir/Madam, Nice day! Please help me about my problem in unknown device to my laptop. This problem appeared when I update my Windows 8.1 for Windows 10. Thanks in advance.

  • Incorrect file extension

    Since last week, I was able to open files with extension .irr with Photoshop CS6.  This week, it does not work and it will open in Microsoft Office instead.  I tried to associate the file extension.  It does not always open to the CS6.  Can you pleas