Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8356557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:13:46+00:00 2026-06-09T10:13:46+00:00

Im a total noob on actionscript, NEVER used it, but Im compiling a Unity

  • 0

Im a total noob on actionscript, NEVER used it, but Im compiling a Unity project to flash, and for doing browser<-> javascript communication I nned to make a hackish thing providing a class on .as code..
The unity is acusing it doesnt know the type string:
“Type was not found or was not a compile-time constant: string.”

Heres my code, note I dont have even a flash compiler, Im using notepad++, so Im on a minefield, dont know the language and cant debug it.

import flash.external.ExternalInterface;
import flash.system.Security;

import global.SCORMInsideActionScriptFunctions;

public class BrowserCommunicator
{
    public static function callFromJavascript() : void
    {
        trace("Javascript successfully called ActionScript function.");
    }

    // callback to register:
    public static function GetSessionTime() : string
    {
        return SCORMInsideActionScriptFunctions.GetSessionTime()
    }


    //Sets up an ExternalInterface callback and calls a Javascript function.
    public static function TestCommunication() : void
    {
        if (ExternalInterface.available)
        {
            try
            {
                ExternalInterface.addCallback("callFromJavascript", callFromJavascript);

                // mine:
                ExternalInterface.addCallback("GetSessionTime", GetSessionTime);


            }
            catch (error:SecurityError)
            {
                trace("A SecurityError occurred: " + error.message);
            }
            catch (error:Error)
            {
                trace("An Error occurred: " + error.message);
            }

            ExternalInterface.call('calledFromActionScript');
        }
        else
        {
            trace("External interface not available");
        }
    }

    public static function FlushData_ServerToCache() : void
    {
        if (ExternalInterface.available)
        {
            // calls the java function here:
            ExternalInterface.call('flushData');
        }
        else
        {
            trace("External interface not available");
        }
    }

    public static function SubmitData_CacheToServer() : void
    {
        if (ExternalInterface.available)
        {
            ExternalInterface.call('submitData');
        }
        else
        {
            trace("External interface not available");
        }
    }

    public static function SetData_AppToCache( field : string, data : string) : void
    {
        if (ExternalInterface.available)
        {
            ExternalInterface.call('setData', field, data);
        }
        else
        {
            trace("External interface not available");
        }
    }

    public static function GetData_CacheToApp( field : string ) : string
    {
        if (ExternalInterface.available)
        {
            return ExternalInterface.call('getData', field);
        }
        else
        {
            trace("External interface not available");
            return "";
        }
    }
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:13:48+00:00Added an answer on June 9, 2026 at 10:13 am

    Just write String instead of string 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

May sound like a total noob question but i'm looking for a javascript (and
Total noob here with javascript. I'm trying to alter a function. This is the
Total noob question, but here. CSS .product__specfield_8_arrow { /*background-image:url(../../upload/orng_bg_arrow.png); background-repeat:no-repeat;*/ background-color:#fc0; width:50px !important; height:33px
I'm a total noob when it comes to C but i found this curl
First timer here, and total noob when it comes to PHP and JavaScript. I
Total noob question here, but not finding the answer via search. What is the
I don't think I am a total noob in OOP, but do you sometimes
OK, total noob question, for msysgit on Windows 7, but I have a remote
I'm a total noob at java, but while practicing tonight it occurred to me
So, i'm a total noob with codeigniter but i'm getting by. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.