0

I need to import from inside flash an Array from a JS function, and display it in Dynamic Text in Flash, my code is :

AS2:

import flash.external.ExternalInterface;

js_btn.onRelease = function() {
    _root.infoBox.text = ExternalInterface.call("getUserInfo()");
}

JS:

function getUserInfo() {
    var userinfo = {fullname: 'George One', username: 'goergeo', picturelink: 'http://link.com'};
    return userinfo;
}

Once I press the button, I get "undefined" in the text box! Any help is really appreciated.

1 Answer 1

1

The correct AS2 code is as below:

import flash.external.*;

js_btn.onPress = function() {
    allUserInfo = Object(ExternalInterface.call("getUserInfo"));
    _root.infoBox.text = allUserInfo["fullname"];
}
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.