Calling javascript with ExternalInterface in Flash 8

Guys,
I have a flash movie with a button. When the user clicks the
button I would like the movie to call a javascript function in the
host page. I have the button on screen. The timeline section shows
the 'up', 'over', 'down' and 'hit' states, then in the middle is an
image of the button. I click on it and in the box below I enter the
following:
quote:
import flash.external.ExternalInterface;
function dosomething():Void {
ExternalInterface.call("foo");
button_blip.addEventListener("click",
mx.utils.Delegate.create(this, dosomething));
At this stage, I just want to see a javascript alert to show
that this is working, but at the moment nothing happens at all..
the javascript function in the host document looks like this:
quote:
<script language="javascript">
function foo(){
alert("abababab");
</script>
Can anybody spot what's missing here? I'm using Flash 8 which
comes with the ExternalInterface API rather than the apparently bad
and buggy fscommand in earlier flash versions.
thanks
christo
note:
I have since moved that bit of actionscript to the first
frame of that layer in the main movie screen - because the AS
debugger said that it has to be on a clip event - the end result
however is no different.

if I understand correctly you need to import the external
API.
import.flash.external.*;
the calls to the api are only available within the timeline
frame in which the above code exists ..

Similar Messages

  • Calling Javascript by ExternalInterface advances playhead?

    HI,
    I'd like to call Javascript function by ExternalInterface while a flash movie is playing. I actually could call a function but the movie looked faster than the expected framerate. It looked like the playhead advanced everytime I called the function.
    After some trials, it seems like...
    Playheads in all MovieClips advances when I call Javascript function by  ExternalInterface.call().
    The playhead advances only while the movie clip is playing. Once it is  stopped, it'll not be advanced until it is played again.
    I made an simple example and attached it to this post so that you can see what I mean.
    The attached file contains an fla file which counts up number from 1 to 5 and is played at 0.5 fps, that is, moves to the next frame every 2 seconds. And there is a button titled "Call JS" which calls a blank Javascript function, which does nothing. If you open the html file, you'll see the number counted up slowly but advanced by one or two frames when you click the button.
    Please look at the first frame of 'action' layer and the js file, if you'd like to see what I did for this with ActionScript and Javascript. You'll see the number not counted up even when you click the button, as I  mentioned above, if you add stop(); at the end of the AS code.
    I'm using Flash CS4 on Mac OS X 10.6. The web browsers are Safari 4.0.4 and Firefox 3.6, and the version of flash player is MAC 10.0.45.2.
    I wonder I'm doing anything wrong or this is the way I shouldn't do. Has  anyone experienced something like this?
    Any help will be much appreciated. Thanks in advance.

    i don't see a problem except the op seems confused.  i'm not sure why (or even if) he expects the playhead to stop when there's no code to stop it.
    anyway,
    1.  the attached files contain no stop().  once added, the playhead stops, as expected.
    2.  there's no doNothing js function.  once added, it executes, as expected.
    3.  the attached files behave, as expected.

  • Calling Javascripts with a panel then prevents copy/paste functions in Photoshop CS5

    Hi,
    I have a simple panel in Photoshop that calls a Javascript when a button is pressed.
    I have a simple script that does some Duplication of layers and a bit of simple image manipulation.
    I run the script from the Extended Toolkit and eveything works fine.
    I run the same script from the Panel and the script runs fine; but then the copy / Paste functionality of Photoshop is broken.
    I have to close the Panel window or run the script from the toolkit to get the functionality back.
    EDIT:  I have not narrowed this down to simple interations with the Panel can casue this issue - clicking on icons, switching `Tabs` etc...
    Does anyone know why this is happening?
    Cheers,
    Pete

    Hi,
    I created a simple panel that only had a button that calls an external JavaScript.
    Even if I simply click on the panel a few times, move it around etc without executing the script, I can get the copy paste error.  It happens 90% of the time and interestingly it only happens on the currently active document.
    The only way to get the functionality back is to close the panel.
    It seems to be a focus issue,  but as I'm not calling any script in this case - where could I put the Bridge Talk command? 

  • How to call javascript function with dynamic data in display tag

    Hi,
    Iam new to pagination concept. Iam using display tag to display rows in jsp by strtus.
    I have a problem when calling the javascript function using ahref in attribute in display tag.
    <bean:define name="form1" property="EditDetails.List" id="ListDisplay"/>
    <display:table name="pageScope.ListDisplay" cellpadding="0" cellspacing="1" pagesize="10" partialList="false" size="listSize" requestURI="">
    <display:column property="poNo" href='javascript:searchEditDetails("./submitOrder.do? actionID=getMISLoadEdit&poNumberSel=<%=((com.po.bean.EditDetails)poListDisplay).getNo()%>&statusIdSelected=<%=((com.po.bean.EditDetails)ListDisplay).getStatusId()%>")'
    title="Number"/>                         
    <display:column property="strDate"title="Date" />
    <display:column property="orderValue"title="Order Value(INR)"/>
    <display:column property="stringRequestedDeliveryDate"title="Suggested Delivery Date"/>
    <display:column property="statusDescription" title="Status" />
    </display:table>
    The above code display the data in row format is working fine when I click the No It thow javascript error and its not redirecting to the other page.
    When I try this with ordinary struts its working fine the code is:
    <logic:iterate id="polist" name="Form1" property="EditDetails.List" indexId="i" type="com.bean.EditDetails">
    <tr>
    <td ><a href="javascript:searchEditDetails("./submitOrder.do?actionID=getMISLoadEdit&NumberSel=<%=((com.bean.EditDetails)polist).getNo()%>&statusIdSelected=<%=((com.bean.EditDetails)polist).getStatusId()%>")"><html:hidden name="polist" property="No" write="true" /></a>     </td>
    <td><html:hidden name="polist" property="strDate" write="true" /></td>
    <td><html:hidden name="polist" property="orderValue" write="true" /></td>
    <td><html:hidden name="polist" property="stringRequestedDeliveryDate" write="true" />     </td>
    <td><html:hidden name="polist" property="statusDescription" write="true" /></td>
    </tr>
    </logic:iterate>
    Please help me how to call javascript with dynamic data.
    Thanks in advance

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • Problem with ExternalInterface.call and Internet Explorer

    Hi, I´m developing a site, (
    www.gen-studio.com/avelart2
    ), and I´m using a swf to display a set of thumbs that when
    clicked show an item and its description on the browser, those
    items might be images or video, everything works fine with the
    images.
    And actually it works fine with the videos too, when using
    Firefox, but when I test the page on Internet explorer it just
    doesn’t work!
    On principle let me describe how it´s supposed to work,
    a thumbnail when clicked sends an id number to javaScript using
    ExternalInterface.call(“myFunction”,myId); -I´m
    using AS3 for the swf´s-
    the javaScript file has already loaded (ever since$(
    document).ready) a XML file which uses to match the id with a file
    and the description, if the item to show it´s a video, then it
    creates a variable which holds a string with the proper html to
    embed a swf (a swf movie player that resides just next to the HTML
    file), when loaded, the swf movie player uses
    ExternalInterface.call() to ask for the source of the video that
    has to play, and that function is as follows:
    setVideo: function(){
    alert("hola");
    return comun.miVideo;
    (The alert(“hola”); is just to test that the
    function is being called), which it is, but it returns null as a
    value instead of the proper string, and this happens only on
    internet Explorer, but works correctly on Firefox.
    I´ve been reading all day about the subject and found a
    few interesting things, which though have made me narrow my
    problem, they haven´t just provided me with a solution, what I
    found so far:
    -I must have in account flash security issues: Checked (my
    actionScript follows:)
    import fl.video.*;
    import flash.external.ExternalInterface;
    flash.system.Security.allowDomain("*");
    var vid:FLVPlayback = this.miPlayer;
    vid.source =
    flash.external.ExternalInterface.call("comun.setVideo");
    -ExternalInterface and Internet explorer don´t work
    properly when tested locally: Checked (I have a server on my PC and
    I´m testing the site as well in the above direction).
    -The object tag holding the swf must have a proper id
    attribute: Checked.
    -It´s super important the way the object tag is formed:
    Checked, and I also tested the tag separately (I put it directly in
    the HTML instead of adding it via javaScript) and it worked as
    expected in both Firefox and Internet Explorer, which leads me to
    believe:
    -I read somewhere that if you add the object tag by using
    innerHTML or appendChild, returning values from javaScript to swf
    won´t work, but I couldn´t find an explanation nor a
    solution.
    Well, as I said now I´ve been looking all day for an
    answer, so I really hope you can help me or give me some advice on
    the subject, thank you so much for your time!

    Hi! it solved itself !! (nahh, I wish), but it indeed had a
    solution, it was something quite simple, and I don´t really
    understand why it was not working in the first place, but here is
    the thing:
    I´m learning jquery and this is the first proyect
    I´m officially using it, so I was using
    $('#myDIV').append("string"); to embed the swf, (and it was working
    perfectly on Firefox), so since I had narrowed my problem to those
    lines, I decided to try some good-old-fashioned-javaScript and
    changed it for: var myDiv =
    document.getElementById('thatParticularDiv'); myDiv.innerHTML =
    ('string'); and it worked both in Firefox and IE !!!!!! :)
    I´m quite happy about it, and if someone knows
    what´s the issue with my jquery approach I would love to hear
    it. THANKS !!

  • Can't Use Dreamweaver Flash Embedding with ExternalInterface

    I've been trying to use ExtermalInterface to call ActionScript 3 functions from JavaScript and have been having a problem when embedding SWF files using Dreamweaver. When I use the sample code at the bottom of the ExternalInterface docs page (http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/external/ExternalInterface.html) the JavaScript/ActionScript function calls work fine. But when I insert a SWF with Dreamweaver CS4 they don't. They do actually work in Internet Explorer 8 but not in Firefox 3.5, Safari 4, or Chrome 3.
    The problem has to do with the the way the SWF embedding is done. On the ExternalInterface page mentioned above a different form of the <object/embed> tags is used than in DW. Here's the sample code from the docs page:
         <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                 id="ExternalInterfaceExample" width="500" height="375"
                 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
             <param name="movie" value="ExternalInterfaceExample.swf" />
             <param name="quality" value="high" />
             <param name="bgcolor" value="#869ca7" />
             <param name="allowScriptAccess" value="sameDomain" />
             <embed src="ExternalInterfaceExample.swf" quality="high" bgcolor="#869ca7"
                 width="500" height="375" name="ExternalInterfaceExample" align="middle"
                 play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
                 type="application/x-shockwave-flash"
                 pluginspage="http://www.macromedia.com/go/getflashplayer">
             </embed>
         </object>
    In DW, instead of an <embed> tag a second object tag is inserted. I did find that by manually giving the second <object> tag its own ID (a different ID from the one given the first tag by DW I could make the function call work in FF. But you would then have to choose the ID based on the browser. And, worse, that technique doesn't work in Chrome or Safari.
    So, the workaround seems to be to use the style of embedding used on the ExternalInterface page. But, I don't like that approach for several reasons. First, the page  won't tell the user they need to upgrade their FlashPlayer if that's a problem. Second, you have to manually copy/past the embedding code instead of using DW's nice menu option. And I suspect there may be other benefits to the DW approach,
    So, is there a way to make the DW embedding style work with ExternalInterface in all the major browsers??
    David Salahi

    Very interesting, thanks for your insight. Dreamweaver does seem to be a black sheep in this regard. Curiously, one of the reasons I wanted to stick with DW is because it highlights the <embed> tag in yellow—which normally means an HTML error. Not being entirely up on the ins and outs of the embed tag I thought maybe it's deprecated or something so wanted to avoid it. But now, I've found that it's apparently the right way to do things.
    I did a little testing; here are my results...
    My SWF was originally generated in FlexBuilder (as an ActionScript project) so I copied over the Flex-generated HTML page and modified it for use with ExternalInterface. That works fine in all four of the browsers I mentioned in my original post.
    Next, I grabbed an HTML page generated by Flash's Publish menu option and made the same modifications. Again, everything was copacetic.
    Each of the three tools (Flash, Flex & Dreamweaver) generate different HTML code for embedding a SWF file and only two of them work with ExternalInterface. I guess I'll steer clear of Dreamweaver's Insert-> Media -> SWF menu option in the future. This cost me an entire day of hair-pulling.
    But thanks for your tip!
    David Salahi

  • Is it possible to embed JavaScript functions into a Flash file (AS 3.0) and call within flash itself, without using the external .js file

    Scenario:
    I have a text area in flash. The user will copy paste any JavaScript  function in the text area and click execute button. The JavaScript function pasted in the text area should be executed with in the flash itself and the return value will be shown in another text field.

    yes,
    function testF(s:String):XML{
        var js:XML = <script>
        <![CDATA[
        ]]>
        </script>
        js.appendChild(XML(s));
        return js;
    ExternalInterface.call(testF(your_tf.text));

  • How can i call javascript function with out internet connection?

    I have trying to call javascript function through ExternalInterface. But flash player recomonding to have internet connectivity. i have allredy used allowscript="always" .

    first, allow the folder that contains your flash files to connect to the internet by adjusting your security settings:
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml
    then try the following in a swf and open the published html in your browser to test:
    import flash.external.ExternalInterface
    ExternalInterface.call("function(){alert('test');}")

  • IPad = webStageView = HTML = call javascript function thru Flash

    Has anyone loaded a HTML file thru webStageView, and then been able to call javascript functions embeded in the HTML through flash.
    I've seen references to using webStageViewBRIDGE but I think that has been depreciated.
    Below is a link to a Adobe tutorial doing this with the htmlLoader class and FLEX.
    Cross-scripting PDF content in an Adobe AIR application
    http://www.adobe.com/devnet/air/flex/quickstart/articles/scripting_pdf.html
    If anyone has successfully been able to do this on the iPad, could you explain how it's done or provide a link to some documentation.
    Thanks...

    Stagewebviewbridge is a 3rd party library (not an official Adobe product). It looks like it is still supported. The technique described should work even if the library isn't being actively developed.
    http://code.google.com/p/stagewebviewbridge/wiki/Communication
    Also, note that most techniques which use the HTMLLoader class will not work with the StageWebView class -- they are entirely different beasts. (Well, to be precise, on desktop computers, StageWebView uses the same Webkit code, but the interface to it is still very different.)

  • How to call html page with in the flash

    I am new to action script, can some one guide me how to call html page with in the flash. lets say i have movie clip having instance name as "news_feed", I need to disply the html page in this news_feed. kindly help me, thanks alot

    some one tell me, weather it is possible or not ??

  • [MVC] Call controller with Javascript - How to pass model?

    Hi,
    In one of my requirement, I have to pass the main model to a controller that I simply create through Javascript (let's say I call it with : window.open( 'http://.../popup.do '); )
    How sould I proceed to set an existing model to this controller?
    Many thanks in advance.
    Best regards,
    Guillaume

    Hi
    u might be having  a model class for your model,
    just insert that model class in the attributes and then u can use that model class for your controller.
    a easy example of creating it is as in this link...
    [creating controllers with model|http://wiki.sdn.sap.com/wiki/x/-YL8B ]
    Give the page attributes of the view. in the page attribute define the model class there that u have created.
    in the view u can use the model class as...
    SELECT_model is the name of the object refering to the model class.
    i_vbak have been defined in the attributes of the model class.
    we are accessing it here in teh view calling it as below.
    and in the model we had fetched the data for the below fields .
      <htmlb:tableView id="TV_VBAK" table="//SELECT_model/I_VBAK">
    <htmlb:tableViewColumn columnName="vbeln"></htmlb:tableViewColumn>
    <htmlb:tableViewColumn columnName="ERDAT"></htmlb:tableViewColumn>
    <htmlb:tableViewColumn columnName="ERZET"></htmlb:tableViewColumn>
    <htmlb:tableViewColumn columnName="ERNAM"></htmlb:tableViewColumn>
    <htmlb:tableViewColumn columnName="ANGDT"></htmlb:tableViewColumn>  
      </htmlb:tableView>
    i hope it is clear.
    Thanks
    kalyan

  • How to call javascript function in Flash

    Please help...
    I have a site that run multiple of domain for example
    Domain (A): raymond.com
    Domain (B): raymond.ca
    The problem is this.. when (B) html page load the flash file
    that locate at (A) it load but non of the buttons work which call
    javascript function using getURL("javascript:showpopup()"); But it
    work fine if all reside on the same domain,eg( (A) html page load
    flash file form (A)). Anyone know how to solve this other than
    create a set of flash files on (B).
    Regards,
    Raymond

    http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?cont ext=Flash_MX_2004&file=00001750.html

  • Using AS2 to Call JavaScript w/ External Interface: What Am I Doing Wrong?

    I am trying to trigger a JavaScript fuction from inside a
    Flash 8/AS2 movie created by my coworker. The JS function is called
    disappear(), which is meant to close the DIV that contains the
    flash movie itself.
    I know the JS works in all my target browsers - it's been
    tested already. Now I need working ActionScript. The ActionScript
    I've been studying is 3.0 so the fact that this task must be
    accomplished in AS2 makes it that much harder for me; I know very
    little about the way Flash Virtual Machine 1 works so I don't know
    where to begin with the code.
    I would like to implement this one of two ways:
    Preferred Method: I'd like to create an AS file that I can
    send to my coworker for inclusion in his FLA along with any code
    necessary for linking the button instance to the class in the AS
    file (don't think code is necessary; linkage done during
    right-click on library panel, right?)
    Alternative Method: I'd like to send my coworker text that he
    can simply drop into the first frame in the movie to make it go.
    I started out trying to call the javascript with on(press) {
    getURL("avascript:myFunction"); }, which worked in Firefox but not
    in IE6 or 7. Then I read over the tutorial here:
    http://www.adobe.com/devnet/flash/articles/external_interface_print.html
    and switched to using ExternalInterface.call() instead. That's
    where I am now. My brain is hurting trying to dig up answers for
    AS2 without reference materials... You are my best hope.
    Please help me make sense of this ActionScript 2.0 code with
    one of the prefered methods above. I am away from my copy of Flash
    8 - I'm using FlashDevelop here at work - so I'd appeciate if you
    could test any suggestions you make before you make them - unless
    you are a Flash genius who I should not be questioning :) I've
    provided the HTML/JS code; all you have to do is make a 500x300 SWF
    and put a button instance in it.
    ----------------------------------------The attempt at
    ActionScript 2.0 (don't
    laugh)----------------------------------------
    import.flash.external.ExternalInterface;
    class JsCallerButton {
    private var _caller_btn:Button;
    //Constructor
    public function jsCallerButton():Void {
    this._caller_btn:Button = new Button();
    this._caller_btn.addEventListener("click", clickHandler);
    //Event handler for event set in class constructor
    function clickHandler(eventObj:Object):Void {
    ExternalInterface.call("disappear");
    ----------------------------------------The
    HTML/JavaScript----------------------------------------
    <html>
    <head>
    <script>
    var timeout;
    function appear(){
    var the_style = getStyle("floatingflash");
    if (the_style) {
    var current_top = parseInt(the_style.top);
    var new_top = current_top + 5;
    if (document.layers) {
    the_style.top = new_top;
    } else {
    the_style.top = new_top + "px";
    if (new_top < 150) {
    the_timeout = setTimeout('appear();',10);
    } // appear
    function disappear() {
    var the_style = getStyle("floatingflash");
    the_style.display = 'none';
    } // disappear
    function getStyle(ref) {
    if(document.getElementById &&
    document.getElementById(ref)) {
    return document.getElementById(ref).style;
    } else if (document.all && document.all(ref)) {
    return document.all(ref).style;
    } else if (document.layers && document.layers[ref]) {
    return document.layers[ref];
    } else {
    return false;
    } // getStyle
    </script>
    <style>
    #floatingflash {
    position:absolute;
    border:1px solid red;
    background:white;
    </style>
    </head>
    <body onload="appear();">
    <div id="floatingflash"
    style="top:-400px;left:-150px;margin-left:50%;">
    <!--This 'X' link is for manual calls to the function that
    should be triggered from inside Flash-->
    <a href="javascript:disappear();">X</a>
    <p>  </p>
    <p>
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
    width="500" height="300" title="Hover Ad">
    <param name="movie" value="
    http://------------------------------/500x300.swf"
    />
    <param name="quality" value="high" />
    <embed src="500x300.swf" quality="high" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" width="500"
    height="300"></embed>
    </object>
    </p>
    <p><a
    href="launch.html">Back</a></p>
    </div>
    </body>
    </html>

    Thank you for your response. The drives are in fact different letters -- I changed the drive name to correspond the original drive letter...but that doesn't seem to have fixed the problem.
    Where I seem to stand is:
    Old computer (with iTunes library) + external hard drive (with iTunes music) work just fine.
    New computer -- iTunes library copied from old computer, iTunes music folder identified in iTunes, but iTunes can't find the music.
    At this point, am I better off starting from scratch with the new computer (in terms of installing iTunes and moving my library over from my old computer)?
    And if so, what would be the best way to approach this?
    Thanks much.

  • Problems with ExternalInterface

    I am trying to have a Flex2 TitleWindow communicate with
    Javascript and then have that Javascript communicate back with the
    ActionScript in the TitleWindow.
    Calling Javascript from ActionScript is working perfectly,
    however, I have not yet been able to successfully call an
    ActionScript method from Javascript.
    My setup is fairly involved, but here are the basic
    components. I would be happy to provide any additional information
    that could help.
    I have a creationComplete event in my TitleWindow which calls
    an initialization function that registered callbacks and then a
    callback function defined in the same TitleWindow.
    public function init():void {
    if (ExternalInterface.available){
    ExternalInterface.addCallback("testCallback", testCallback);
    Alert.show("Callbacks are registered");
    else{
    Alert.show("ExternalInterface was not available");
    public function testCallback():void {
    Alert.show("Received callback from Javascript");
    Then when the user clicks a button on the TitleWindow, I do
    the following:
    ExternalInterface.call("jsFunction", "foo", "bar");
    In my Javascript, I have the following:
    var jsFunction = function(string1, string2){
    alert("Received: " + string1 + ", " + string2);
    flexObject.testCallback();
    In my Html, I have the following to imbed flex
    <object id='flexObject' codebase='
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'
    height='100%' width='100%'>
    <param name='src' value='flexapp.swf'/>
    <param name="allowScriptAccess" value="always"/>
    <embed name='flexObject' src='flexapp.swf'
    allowScriptAccess='always' pluginspage='
    http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'
    height='100%' width='100%'/>
    </object>
    Now, I can load the html page just fine and everything look
    great and is functional. When I go to the TitleWindow in question
    and click the button that calls the Javascript, it works perfectly
    and I see the Javascript alert box displaying "Receiving: foo,
    bar". However, I never get any response from the ActionScript
    callback that should be called at that point by the Javascript.
    Looking at it more closely, I have been able to determine
    that flexObject.testCallback is undefined at the point I try to
    call it in my Javascript. Javascript is unable to see that this
    method exists. If I try to use Firebug to trace the Javascript side
    of things, it crashes at the flexObject.testCallback line.
    I have tried doing:
    flexObject.testCallback();
    document.getElementById("flexObject").testCallback();
    testCallback();
    None of them work. Has anyone had luck with this? I have
    tried it with FireFox 2 and IE 6 with the same result.

    Never mind, it was some crazy-*** unrelated problem where JavaScript working in IE didn't work in FF.

  • Embedded .swf's calling javascript from air container

    1) I have an html/ajax air app version 1.5.1
    2) This air app embeds .swf files from an external source / web server & plays the embdded .swf inside air.
    3) The embedded .swf file has a button with an onClick event
    function onClick(event:MouseEvent):void {
    ExternalInterface.call("someJavascriptMethod()" );
    4) The javascript method to be called is already parsed inside the containing Air app and is waiting to be triggered.
    5) When the onClick is triggered, the following error is thrown.
    Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX,
    Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.
    at Error$/throwError()
    at flash.external::ExternalInterface$/call()
    at stress_fla::MainTimeline/onClick()
    6) On investigation I found on your livedoc's website that Air does not support the ExternalInterface.call method.
    http://livedocs.adobe.com/labs/air/1/aslr/flash/external/ExternalInterface.html
    Look for Note: Adobe AIR currently does not support the ExternalInterface class.
    7) Does anyone here know how I can get an embbeded .swf file to call javascript methods in the containing air application? I have had a look at the getUrl method but this is now longer supported & even the FS command but still to no avail. I may have a work around by inserting a DOM element over the top of the embedded .swf but this is not an elegant solution & want the .swf to talk directly to the air app container.
    All help & comments welcome
    Thanks
    Kyle
    Additionally I have found
    http://help.adobe.com/en_US/AIR/1.5/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7ed4 .html
    Using the Html Loader so that Actionscript can call/manipulate the dom objects. At first I was whopee but then I tried the examples listed in the help. The HTMLLoader class is only available in Air. When trying to use import flash.html.HTMLLoader; Flash C4 complains that the Definition cannot be found on compile time & therefore does not export my movie correctly. Has anyone else had this problem or have a solution??
    More additions:
    The reason the htmlLoader class was not compiling was due to the source action script provided being ActionScript 2.0 - the htmlLoader class is a 3.0 library.
    However, after more investigation I have found the current structure.
    The air app has an html base/root doc. On periodic javascript events - .swf files are downloaded via
    videos = new air.Loader();
    netStream     = new air.URLRequest(path + file);
    videos.load(netStream);
    So now I have a html container in my air app that creates a new air.Loader which downloads the external .swf file in which I want an onClick event in the action Script of the downloaded .swf file to call a Javascript method of the parent air container. Simple yea?
    Or am I making life to hard for myself? Have been looking at the security snadboxes but I don't see how I can get the .swf file to talk nicely with the outer air container. Please help if able.
    Thanks
    Kyle

    Hi Kenneth,
    Your explanation makes sense.
    I have a big JavaScript file full of special mathematical functions written by a mathematician who only knows how to program in Javascript.
    I need to call the Javascript functions from within an ActionScript library, which obviously has no UI, and thus HTML and/or HTMLLoader are not an option.
    Any ideas?
    TIA,
    mlavie

Maybe you are looking for

  • Can I plug my iPad into an outlet in France for recharging, or do I need a converter (besides de adapter...)?

    Can I plug my iPad into an outlet in France for recharging, or do I need a converter fo the voltage?

  • Comparing special characters in UNIX

    #!/usr/bin/ksh v_v_delimiter='|' v_v_delimiter1='|' echo $v_v_delimiter echo $v_v_delimiter1 if [ "$v_v_delimiter" = "$v_v_delimeter1" ] then echo if else echo else2 fi echo $v_v_delimiter The above script gives output as | | else2 | This is incorrec

  • AirPort or AirPort Extreme Carcd

    Hi everyone I'm a newbi to the Mac world and I have a iMac G4 1ghz that I would like to make wireless according to the doc I found on the web it says that it is AirPort Extreme ready ,but when I went to the Apple's online store it says that it can no

  • SL can't access setup for aluminum Bluetooth keyboard

    Snow Leopard can't find my bluetooth aluminum keyboard when I click "Setup Bluetooth Keyboard..." button in Keyboard portion of the System Preferences. When I go to System Prefs and try to access the settings, SL just spins the progress wheel and tim

  • Some LR4 issues / requests

    1) it seems that (on the mac) the folder with lens profiles has moved from /Library/Application Support/Adobe/CameraRaw/LensProfiles/1.0/ to a private copy inside the application package: /Applications/Adobe Photoshop Lightroom 4.app/Contents/Resourc