1
HTML 페이지 (자바 스크립트 사용)에서 swf 파일 (액션 스크립트 2)로 문자열을 보내려고했습니다.javascript에서 actionscript IE 문제로 보내기
Google에서 검색 한 결과 this page입니다.
:
하지만, 예제 코드 (개체가이 속성 또는 메서드를 지원하지 않습니다 IE는 말했다) IE에서 작동하지 않았다 (버전 1이 아닌 2, 당신은 소스 파일 .ZIP에서 찾을 수 있습니다) 문제가 어디에 있습니까? (나는 데 SWFObject를 사용하지 않습니다.)액션 스크립트 :::
//From Evan Mullins @ circlecube.com
//View post at http://blog.circlecube.com/2008/02/01/actionscript-javascript-communication/
import flash.external.*;
//Set up Javascript to Actioscript
var methodName:String = "sendTextFromHtml";
var instance:Object = null;
var method:Function = recieveTextFromHtml;
var wasSuccessful:Boolean = ExternalInterface.addCallback(methodName, instance, method);
//Actionscript to Javascript
//ExternalInterface.call("recieveTextFromFlash", _root.theText.text);
function recieveTextFromHtml(t) {
_root.theText.text = t;
}
_root.button.onRelease = function() {
ExternalInterface.call("recieveTextFromFlash", _root.theText.text);
_root.theText.text = "";
}
JS :::
function recieveTextFromFlash(Txt) {
document.getElementById('htmlText').value = Txt;
}
과 온 클릭 JS 코드 :::
을getElementById('flash').sendTextFromHtml(htmlText.value); document.getElementById('htmlText').value = ''
감사합니다.