Problem with ExternalInterface.addCallback("IsStatic",IsStatic)

I am trying to add an ExternalInterface.addCallback("IsStatic",IsStatic) to get a string back to a javascript function so that I can put "visible" the title 'film clip' property to 'true '. Can someone tell me what I am doing wrong? Here is my code AS:

Code:
ExternalInterface.addCallback("sendToActionscript", getFromJavascript);
     function getFromJavascript(isClosed)
     {
          if (isClosed == "closed") {
          title.visible=true;
          }
     }

.. and here's my javascript:

Code:
<script type="text/javascript">
<!--
//check for IE
function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
}
function sendToActionscript(str)
{
     //bigbook.swf is my embedded Flash file
     getFlashMovie("bigbook").sendToActionscript(str);   
}
//-->
</script>

.. What is called when a user clicks on a link, like this:

Code:
<a href = "#" onClick="sendToActionScript('closed');">click</a>

Any help is greatly appreciated.

you have a typo in your onClick:

 sendToActionscript

is not the same as:

sendToActionScript

Tags: Adobe Animate

Similar Questions

  • Need help with ExternalInterface.addCallback("IsStatic",IsStatic))

    The simple code below returns this error: "1067: Implicit coercion of a value of type String to a type unrelated function." when it is compiled in strict mode.

    It seems so simple. What I'm missing here?

    Thank you.

    Problem solved as soon as I turned into a normal function.

  • JavaScript error when using ExternalInterface.addCallback("IsStatic",IsStatic) with cross-domain swf file

    How can I use ExternalInterface.addCallback("IsStatic",IsStatic) when using javascript server access (html) of server B (swf)? coz it showing error?

    Server A
    192.168.0.10/xxx/example.html
    ===========
    < object classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    ID = "MGSInsurances1" width = "960" height = "600".
    codebase =" http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" > "
    "" < param name = "movie" value = " http://192.168.0.22/MGS/flex/MGSInsurances1.swf" / >
    < param name = "quality" value = "high" / >
    < param name = "bgcolor" value = "#869ca 7" / >
    < param name = "allowScriptAccess" value = "always" / >
    "" < embed src = " http://192.168.0.22/MGS/flex/MGSInsurances1.swf" quality = "high" bgcolor = "# ca 869, 7.
    width = "960" height = "600" name = "MGSInsurances1" align = "middle".
    play = "true".
    Loop = "false".
    quality = "high".
    allowScriptAccess = "always".
    Type = "application/x-shockwave-flash".
    pluginspage =" http://www.adobe.com/go/getflashplayer_fr" > "
    < / embed >
    < / object >
    < script language = "javascript" >
    window. MGSInsurances1 = document.getElementById('MGSInsurances1');
    < /script >

    Server B
    192.168.0.22/mgs/Flex/MGSInsurances1.swf
    ==================

    Security.allowDomain("*");

    If (ExternalInterface.available)
    {
    ExternalInterface.addCallback("IsStatic",IsStatic) ("onchange", onchange);
    ExternalInterface.addCallback("IsStatic",IsStatic) ("datachange", datachange);
    }

    but javascript Error shows "Unknown name", how can I solve this problem? urgent! Anyone know this?

    I solved it! because I did not restart my server again! Again not error! Sorry to annoy everyone.

  • ExternalInterface.addCallback("IsStatic",IsStatic)

    I get an error 1065, which is a reference error.

    I have an html page that loads a flash swf file.

    the error is on the ExternalInterface.addCallback("IsStatic",IsStatic) statement.

    If I use a flash swf with code file in this file I have no problem with the external interface.  It communicates with

    the html page.

    If I take that same flash program and create a class (.as) file and put my code in the

    class file, I get the error.  If I comment on a statement in the file .as ExternalInterface.addCallback("IsStatic",IsStatic)

    There is no error.  Code in the .as file and all other functions work except the addcallback statement.

    I looked for a solution and looked at examples of code and it seems that I'm set up correctly.

    I tried on opera, ie, and chrome with the same results.

    is there a piece of the puzzle that I'm missing?

    Thank you

    not serious.

    I just added the sendToActionScript function in my .as flash file and the error disappeared

    I looked on my original flash program that had all the code in frame 1 and I got the function to call in

    Here, but not to add the function when I tried to create a document class.

    Totally my mistake and thank you for your help in pointing out my mistake.

    I really appreciate your help and for the forum.

  • ExternalInterface.addCallback("IsStatic",IsStatic) doesn't seem to work.

    Continuation of this post on the forum here:
    http://forums.Adobe.com/thread/885200?TSTART=0

    I have some difficulty to the ajax result in flex... as an event so I need to keep the control in flex. what I understand, a reminder is necessary, so I set up a reminder with the flex parts here:

    " < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx".
    xmlns:bridge = "bridge.*".
    minWidth = minHeight = "955" "600" creationComplete = "application1_initializeHandler (event)" >

    protected function application1_initializeHandler(event:FlexEvent):void
    {
    ExternalInterface.addCallback("IsStatic",IsStatic) ("EICallBack", EICallBack);

    }
    protected function EICallBack(Result:String)
    {
    output = result;
    }

    protected function button1_clickHandler (eventLMouseEvent): void)

    {

    ExternalInterface.call("saveglobalscore",score) ("ExecuteFunction", Value);

    }

    On the side of javascript
    I created a function delegate
    function ExecuteFunction (arr)

    {

    testFunction (arr). EICallBack (output) //where output is set to output = xmlHttp.responseText instead of the alert with a subsequent return output

    }

    but the EICallBack is never executed.
    I looked at other examples, and they look quite similar. I don't know what I'm doing wrong.  Can anyone help?

    What does ExecuteFunction (arr)?  It does not return the object containing the

    Player?

  • JavaScript in IE6 for ExternalInterface.addCallback("IsStatic",IsStatic) errors

    I'm having a terrible time, get the bridge to work in IE6. (A working Firefox prototype took every 20 minutes).
    I use UFO ( http://www.bobbyvandersluis.com/ufo/) to load the .swf file. However, when it comes to the ExternalInterface.addCallback("IsStatic",IsStatic) in FABridge.as, IE throws opaque JavaScript errors: line 1, Char 22 syntax error. If I comment all ExternalInterface.addCallback("IsStatic",IsStatic) calls, IE gets beyond that, however, nothing works as well (which is not surprising). Have I missed something obvious with respect to IE?
    Any help would be appreciated.

    It seems that my code above not correctly set the object/@id on the Flash object. Once I added id: "graph" the UFO.create initialization parameter, everything went great.

  • Problem with ExternalInterface.      addCallback and GoogleChrome

    Hi all

    I'm developing a FLEX application that need to interact with FACEBOOK.

    I currently use the FACEBOOK JAVASCRIPT API.

    I have craete function callback in FLEX and I call the external JS with the EXTERNALLINTERFACE:

    flash.external.ExternalInterface.addCallback ("gettedMyInfo", gettedMyInfo);

    If {(ExternalInterface.available)
    ExternalInterface.call("saveglobalscore",score) ("isConnectedFlex");
    }

    In the facebook JS code doing what he wants to do and then I call (previously in the HTML code I check the FB login, init of the API and so):

    function isConnectedFlex() {}
    {FB.getLoginStatus (function (response)}
    If {(response.session)
    returnSession0K (response.session.uid);
    } else {}
    FB.login (handleSessionResponseFlex);
    }
    });

    }

    function returnSession0K (uid) {}
    getInfoUser (uid);
    }

    It works fine with firefox and ie but not with GoogleChrome who always return: Eception TypeError: can't call method "gettedMyInfo" undefined

    ExternalInterface.call("saveglobalscore",score) ("isConnectedFlex"); also works very well in Chrome.

    I have read the livedocs and I found:

    Error -The container does not support incoming calls.                 Incoming calls are supported only in Internet Explorer for Windows and browsers that use the NPRuntime API such as Mozilla 1.7.5 and later versions or Firefox 1.0 and later versions.

    Thus, it seems that Google does not support the addCallback method...

    Is there a solution or a workaround to use FB JS API with Chrome?

    Or I have to use the Api FB Flex? [I preffer to use JS api because it seems faster and well-designed]

    Thanks for your time

    Marco

    What is thisMovie in the next line?

    thisMovie("flashContent").gettedMyInfo(data);
    

    Try substitution, which follows.

    getElementById("flashContent").gettedMyInfo(data)
    
  • ExternalInterface.addCallback("IsStatic",IsStatic) broken on older versions of IE (8 &amp; 9)

    After installing the debug labs version, I was no longer able to add an ExternalInterface callback my SWF.  Any attempt to do so would be even just stay "defined", so although swfobject even Bobby van Der Sluis test suite would not work, http://www.bobbyvandersluis.com/swfobject/testsuite_2_2/test_dynamic_com.html.  The 'SetVar' button would work, but not "ExternalInterface".

    This caused an excessive amount of pain for us because we use the AS3 Facebook SDK that uses reminders of the external interface to communicate with their JS SDK, so our full Facebook game was redundant.

    Thanks for the note.  We have taken this test after the beta came out, and it is set in our daily version.  The fix will be in the public version.

    Thank you!

  • sendToActionScript problem with Internet Explorer

    I try to send a function to my SWF file in an HTML file, and all browsers works fine

    with the exception of Internet Explorer.

    The test file is supposed to animate the graph when you hover over the click Word, and

    stop on the passage of the mouse out of it.

    Here's the example URL:

    http://www.sirbgb.com/Sotiris/final/test.html

    Can someone please help me get this to work on Internet Explorer? Here is my HTML code:

    start *.

    < script type = "text/javascript" >
    function sendToActionScript (str) {}
    document ["accelachart"] .sendToActionScript (STR);
    }
    < /script >

    < a href = "#" onmouseover = "sendToActionScript ('fast')" onmouseout = "sendToActionScript ('slow')" > click < /a > "

    < object width = "320" height = "190" id = "accelachart" >
    < param name = "movie" value = "accelachart.swf" >
    < param name = "allowScriptAccess" value = "always" / >
    < embed src = "accelachart.swf" width = "320" height = "190" name = "accelachart" allowScriptAccess = "always" > "
    < / embed >

    < / object >

    end *.

    Here is my AS3 code:

    start *.

    var speed: number = 0;

    var: timer = new Timer (200);
    timer.addEventListener (TimerEvent.TIMER, onTimer);
    Timer.Start ();

    function onTimer(e:TimerEvent):void {}
    If {(ExternalInterface.available)
    ExternalInterface.addCallback("IsStatic",IsStatic) ("sendToActionScript", fromJS);
    Timer.Stop ();
    timer.removeEventListener (TimerEvent.TIMER, onTimer);
    Timer = null;
    }
    }

    function fromJS(str:String):void {}
    If (str == "fast")
    acceleration =. 5;
    on the other
    acceleration = - 4;
    }

    end *.

    As I said before, it works on all browsers I tested (Chrome, FireFox, Safari) with the exception of IE (7 or 8).

    Thanks a lot to anyone who can help you with this. It affected me for quite awhile.

    I don't know who is line 10, but perhaps the problem is this line:

    IE may be choking on the # or on calling a function from a mouse over event.

    You might want to add an alert call to the JS to see if either function is being called. You might also turn on script debugging in IE. You can do that from Tools...Internet Options... Advanced...Disable Script Debugging, this may give you better information to work with.

    href=" #"="" onmouseover="">
  • 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

  • Gallery of images, problems with Flash player 9 and Opera 9

    Hi, I'm developing a slide show in flash (and php, JavaScript, XML).
    I'm coding in AS2 and classes.
    I use the class ExternalInterface to communicate between swf and html file.

    The problem is that the slide show does not work in Opera browser.
    It seems that it works very well, but after a few clicks, it stops responding.
    No problem in IE and FF.
    I search and search for a solution to this problem without success.

    I put an example of slide show here:
    http://www.coldminer.com/up/SW.php?thumbs=1

    The strange thing is that when I use really simplified versions of the code
    I use (with no externalInterface etc.) it works fine:
    http://www.coldminer.com/FTest/

    All those who have experienced similar problems and can guide me towards a solution.

    Version of the opera: 9.02 (8585)
    Flash player version: 9,0,16,0

    Thank you!

    * Edit->
    I found a solution, I replaced th ExternalInterface with 'Flash JavaScript intégration Kit',
    and all my problems with Opera has been resolved.

    Hi, I'm developing a slide show in flash (and php, JavaScript, XML).
    I'm coding in AS2 and classes.
    I use the class ExternalInterface to communicate between swf and html file.

    The problem is that the slide show does not work in Opera browser.
    It seems that it works very well, but after a few clicks, it stops responding.
    No problem in IE and FF.
    I search and search for a solution to this problem without success.

    I put an example of slide show here:
    http://www.coldminer.com/up/SW.php?thumbs=1

    The strange thing is that when I use really simplified versions of the code
    I use (with no externalInterface etc.) it works fine:
    http://www.coldminer.com/FTest/

    All those who have experienced similar problems and can guide me towards a solution.

    Version of the opera: 9.02 (8585)
    Flash player version: 9,0,16,0

    Thank you!

    * Edit->
    I found a solution, I replaced th ExternalInterface with 'Flash JavaScript intégration Kit',
    and all my problems with Opera has been resolved.

  • Problems of ExternalInterface

    Hello

    I'm having a problem with the ExternalInterface class. I use the example of the Flash help (slightly changed, I'll join code shortly), but when I try to send a message to ActionScript, I get the error "eception exception: error calling method on NPObject!» [plugin exception: error in Actionscript.] Use a try/catch block to find the error.]. ».

    I can't understand what is wrong. I will attach the code for my document class for the sample and the html file in which the swf is embedded. Anyone who can shed some light on it would be a huge favor. Thank you!

    OK, the problem is NOT in the code or anything else related to the previous article. It turns out that the problem was due to the fact that I had not seen my file via http, but rather simply open windows Explorer, navigates to the file with the html page and double-click it to open it. It was opened as a local file (with ' line:... ") ("in the browser's address bar) instead of a file on the server. I went into IIS and set up a virtual folder pointing to my folder, navigated to the file via http, and it worked without any problem at all.

    People from Adobe, you can add a comment to this topic to the documentation of the class ExternalInterface on livedocs. Good luck, everyone!

  • problems with, phone, 6, Bluetooth kit, Nissan, after update, for, Rios, 1.0.2

    After the update to ios 10.0.2 - trying to use bluetooth to call my vehicle, it says: "this article is not in your phone book." How can I solve this problem?

    Greetings, joybelino1!

    Thank you for joining the communities Support from Apple! I can't wait to see that you are having problems with your Bluetooth in your car! The good news is that Apple has a great article that will help you with measures to try to resolve the problem. Read this article to gethelp to connect your iPhone, iPad, or iPod touch with your car radio. Even though he talks about problems with the connection, it also has the steps for other questions you may have once connected.

    If you use Bluetooth

    1. Consult the user manual of your car stereo to get the procedure to a Bluetooth device.
    2. On your iOS device, drag up to open Control Center, then press ontwice to turn on Bluetooth and turn it back on.
    3. Restart your iOS device.
    4. On your iOS device, Cancel the twinning of your car radio. On the screen of your car désapparier your iOS device and any other device. Restart your car and your iOS device, then pair and connect again.
    5. Update your iOS device.
    6. Install the updates to the firmware of your car radio.
    7. If you still not connect, contact Apple technical support.

    Have a great day!

  • Anyone having problems with WiFi connectivity after upgrade to Sierra?

    I was wondering if anyone else knows issues with WiFi connectivity since the upgrade to Sierra 10.12? I have not had any problems with connectivity WiFi previously on El Capitan. Now I have regular randomly loose connectivity. My internet is cable and when it is connected I have a 100% connection. My details of iMac and I have used only 10% of my storage.

    No problem with my iphone 6.

    Hello AspDesigns,

    I understand that, since the upgrade to Mac OS Sierra, your Mac seems to have trouble staying connected to Wi - Fi. Fortunately the diagnosis built-in wireless can help identify the source of so much trouble.

    Search for Wi - Fi using your Mac problems

    See you soon!

  • Problems with mail after switching to macOS Sierra

    Hey all

    After having recently upgraded to macOS Sierra, I am unable to read my mail.

    I get the following error every time I check on "Get Mail".

    There may be a problem with the mail server or the network. Check the account settings "*" or try again.

    The server returned the error: Mail could not connect to the server 'pop1.tribcsp.com' using SSL on the default ports. Verify that this server supports SSL and that your account settings are correct.

    What does this error message mean and how can I solve this problem.

    Thank you

    Hi Michael,

    I see your message that you get an error in the mail indicating that there is a problem with the mail server or the network.  To help get this problem resolved, I suggest that you follow the steps below:

    If mail refers to a problem with the mail server, or the network

    Mail will say that it is impossible to connect due to a problem with the mail server or the network. For example, the message may refer to a connection that has expired, or too many simultaneous connections:

    If you are connected to the Internet, but the connection has expired, your email provider might be affected by a discontinuance of service. Contact them or see their status Web page to ensure that their e-mail service is online. Examples of status pages:

    If the message indicates the number of simultaneous connections, too many of your devices is check your e-mail account at the same time. Quit Mail on one or more of your other devices.

    If you are still unable to send or receive e-mails

    1. Make sure that you have installed latest version of the Mac software updates, especially if the problem occurred immediately after the installation of a previous update.
    2. In OS X El Capitan or later version, you can see a status icon and the short error message in the upper right of the Mail window, under the search box. The message may indicate 'Network offline' or 'Connection failed', for example. Click the message to see more details on the issue.
    3. Check your connection to the Mail connection doctor. It might be able to say more on the issue.

    If you cannot send or receive e-mail on your Mac.

    Take care.

Maybe you are looking for