I'm trying to edit some flash to make an external javascript function call, but with no success. Here's my actionscript 2.0 code:
//testing external .js calls
import flash.external.ExternalInterface;
//attempting to make external js call
ExternalInterface.call("createPlaylist","It's my Life!");
and here's my javascript;
function createPlaylist(mess){
alert("called createPlaylist: " + mess);
}
I've seen lots of examples and I'm mainly confused about the use of ExternalInterface.addCallback
. I don't need the javascript to return anything to flash, so is this necessary?
For whatever reason, I never see the alert. Does anyone see any problems in my code? Is there some ExternalInterface
library I don't have? Also, what's the BEST way to use ExternalInterface
(ie; error checking, etc.) Thanks in advance...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…