Copy link to clipboard
Copied
i writing java check. Pass status coming to javaScript.
so how to sent this JavaScript pass/fail value to as3.
JavaScript in browser:
<script language="JavaScript" type="text/javascript">
if (deployJava.versionCheck('1.5') || deployJava.versionCheck('1.6'))
{
document.getElementById('JavaRequired').innerHTML="Java Runtime : <span style='font-weight:bold'>Pass</span>";
}else
{
document.getElementById('JavaRequired').innerHTML="Java Runtime : <span style='font-weight:bold'>Fail</span>";
}
</script>
Finally got it.
<script language="JavaScript" type="text/javascript">
function sendToFlash(){
if (deployJava.versionCheck('1.5') || deployJava.versionCheck('1.6'))
{
document.getElementById('JavaRequired')
return true;
}else
{
document.getElementById('JavaRequired')
return false;
}
</script>
Copy link to clipboard
Copied
Search Google for a tutorial on the ExternalInterface class. Use search terms like "AS3 ExternalInterface tutorial"
Copy link to clipboard
Copied
i tried but not getting pass value. (basically i don't know javascript)
i took from http://flexion.wordpress.com/2007/08/21/external-interface-tip/
as3
var CallFun:String = ExternalInterface.call("javacheck");
function javaResult():void
{
if (CallFun == "Pass")
{
trace('Yes')
}
else
{
trace('No')
}
}
Javascript
<script language="JavaScript" type="text/javascript">
javacheck();
function javacheck(){
if (deployJava.versionCheck('1.5') || deployJava.versionCheck('1.6'))
{
document.getElementById('JavaRequired').innerHTML="Java Runtime : <span style='font-weight:bold'>Pass</span>";document.write('Pass');
}
}else
{
document.getElementById('JavaRequired').innerHTML="Java Runtime : <span style='font-weight:bold'>Fail</span>";
document.write('Fail');
}
</script>
Copy link to clipboard
Copied
As I suggested, search using the terms I provided. The page you are looking at seems to be more of a special case for the person who wrote it, and it is for an AS2 file, not an AS3 file.
Copy link to clipboard
Copied
Hi Ned murphy i tried but no use please help..
Copy link to clipboard
Copied
You tried what? Here are some links from the search I said to use that show you how to use the ExternalInterface class with AS3...
http://active.tutsplus.com/tutorials/actionscript/flash-html-javascript-externalinterface/
http://meshfields.de/externalinterface-call-as3-javascript/
http://actionscript.flashankaractive.com/externalinterface-addcallback/
Copy link to clipboard
Copied
Finally got it.
<script language="JavaScript" type="text/javascript">
function sendToFlash(){
if (deployJava.versionCheck('1.5') || deployJava.versionCheck('1.6'))
{
document.getElementById('JavaRequired')
return true;
}else
{
document.getElementById('JavaRequired')
return false;
}
</script>