Problem with ExternalInterface.call and InternetExplorer

Ask a Question related to Macromedia Flash Data Integration, Design and Development.

  1. #1

    Default Problem with ExternalInterface.call and InternetExplorer

    Hi, Iīm developing a site, ([url]http://www.gen-studio.com/avelart2/[/url]), 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.setVi deo");


    -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!


    tcarrillo158 Guest

  2. Similar Questions and Discussions

    1. Type Error with ExternalInterface.call();
      Hi... I am calling javascript function of wrapper from flex. The funcation is called but when it return a value , the value is not returned to...
    2. Return value from ExternalInterface.call method
      Hi people, I can not achieve to get any return value from javascript other than null. In th HTML container I have a functions like this: ...
    3. ExternalInterface.call performance question
      Hi, I'm using Flash 8, using XML.Load to get some data from another site and returning it to the browser world thru a callback using...
    4. CFHEADER, CFCONTENT, Acrobat 6.0 and InternetExplorer problem...
      Originally posted by: cf_menace This works perfectly with Acrobat 6.0 and MSIE 6.0. The key to getting the PDF plug-in to save the PDF as the...
    5. Problem with InternetExplorer.Application
      Please do not multipost. Ray at work "Killian" <Killian@discussions.microsoft.com> wrote in message...
  3. #2

    Default Re: Problem with ExternalInterface.call and InternetExplorer

    I checked you link but I didn't see anything, but I think I understand what
    you're talking about. There is an issue with cross domain security and using
    objects with IE, Microsoft doesn't allow it. I think, assuming I'm on the right
    track with understanding your issue, the way you can get cross domain data in
    IE is to use an IFrame.

    xchanin Guest

  4. #3

    Default Re: Problem with ExternalInterface.call and InternetExplorer

    Sorry! my bad, I wrongly entered the link, but already corrected it, I hadnīt
    heard about what you tell me - I must consider using i-frames ? -though, I have
    almost narrowed my problem to a few lines of javascript, the ones that embed
    the swf into the HTML, (if you have the time to check it of course :P )
    [url]http://www.gen-studio.com/avelart2/bases/avelart.js[/url] lines 98 to 121, thank you
    so much for answering ! :)

    tcarrillo158 Guest

  5. #4

    Default Re: Problem with ExternalInterface.call and InternetExplorer

    Seems to work huh. At least I was able to see the intro video in both IE and FireFox.
    xchanin Guest

  6. #5

    Default Re: Problem with ExternalInterface.call and InternetExplorer

    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 !!

    tcarrillo158 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139