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愀 supposed to work, a thumbnail when
clicked sends an id number to javaScript using
ExternalInterface.call(?myFunction?,myId); -I惴 using AS3 for the swf愀-
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愀 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:
[i]
setVideo: function(){
alert("hola");
return comun.miVideo;
}[/i]
(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扉e been reading all day about the subject and found a few interesting
things, which though have made me narrow my problem, they haven愒 just provided
me with a solution, what I found so far:
-I must have in account flash security issues: Checked (my actionScript
follows:)
[i]
import fl.video.*;
import flash.external.ExternalInterface;
flash.system.Security.allowDomain("*");
var vid:FLVPlayback = this.miPlayer;
vid.source = flash.external.ExternalInterface.call("comun.setVideo");[/i]
-ExternalInterface and Internet explorer don愒 work properly when tested
locally: Checked (I have a server on my PC and I惴 testing the site as well in
the above direction).
-The object tag holding the swf must have a proper id attribute: Checked.
-It愀 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愒 work, but I couldn愒
find an explanation nor a solution.
Well, as I said now I扉e 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!
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 !!