• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Javascript status send to as3

Engaged ,
May 26, 2012 May 26, 2012

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>

TOPICS
ActionScript

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , May 26, 2012 May 26, 2012

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>

Votes

Translate

Translate
LEGEND ,
May 26, 2012 May 26, 2012

Copy link to clipboard

Copied

Search Google for a tutorial on the ExternalInterface class.  Use search terms like "AS3 ExternalInterface tutorial"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 26, 2012 May 26, 2012

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2012 May 26, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 26, 2012 May 26, 2012

Copy link to clipboard

Copied

Hi Ned murphy i tried but no use please help..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2012 May 26, 2012

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 26, 2012 May 26, 2012

Copy link to clipboard

Copied

LATEST

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines