12 Replies Latest reply on Jan 4, 2012 10:29 PM by anikethm

    Security error:external Interface

    anikethm Level 1

      Hi, I m trying with ActionScript to Javascript Communication. When i run through command

      prompt using "adl" then i m able to get the output but when i run in I.E browser its showing

      Security Error:External Interface. Here is my code.


      When i click on send button in swf file which is embedded in html, it should

      call receiveComplexDataTypes() function in javascript which it is not calling and generating Security Error








      <body scroll='no'>



      <SCRIPT LANGUAGE="JavaScript">

          function receiveComplexDataTypes(o) {

              alert("Welcome " + o.fname + " " + o.lname + "!");

              return "successful";





      <h1>Data Type Wrapper</h1>



      <table width='100%' height='100%' cellspacing='0' cellpadding='0'>


              <td valign='top'>

                  <object id='mySwf' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab' height='200' width='400' >

                      <param name='src' value='DataTypeSender.swf'/>


                      <param name='flashVars' value=''/>

                      <embed name='mySwf' src='DataTypeSender.swf' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' height='100%' width='100%' flashVars=''/>


                                    <input type="text" id="t1"/>










      import flash.external.*;


           public function callWrapper():void {

              var s:String;

              if (ExternalInterface.available) {

                 var o:Object = new Object();

                 o.fname = "Nick";

                 o.lname = "Danger";

                 var wrapperFunction:String = "receiveComplexDataTypes";

                 s = ExternalInterface.call(wrapperFunction, o);

              } else {

                 s = "Wrapper not available";







      <?xml version="1.0"?>

      <!-- wrapper/DataTypeSender.mxml -->

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

        <mx:Script source="DataTypeScript.as"/>


        <mx:Button label="Send" click="callWrapper()"/>

        <mx:Label id="l1"/>




      Please Help me to run this Simple app in Browser.