0
public  function getTextId():String
{
    return val;
}

ExternalInterface.addCallback("getId", getTextId);

I am getting the following error:

Access of undefined property getTextId. ExternalInterface.addCallback("getId", getTextId);

But I have getTextId defined and all the tutorials indicate this is the correct method to do it.

1
  • The code above should work just fine - could you paste in / upload the entire Class Definition and HTML page so we can try it locally? Commented Apr 4, 2012 at 9:27

1 Answer 1

1

Is your call to ExternalInterface.addCallback() inside of a method, or are you calling it a the "class level" (for lack of a better term), as shown in your code snippet?

I just tried adding the callback outside of a method, it worked... not surprised but I rarely code that way. However, I added second method as a callback, and got the same error as you at compile time.

Strange that it works for one method but not the other (no matter what I seem to try).

Have you tried moving the addCallback line into a function or the constructor? This fixes the error for me.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.