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

  • SEARCH
  • Home
  • 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 8256267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:48:25+00:00 2026-06-08T01:48:25+00:00

I am hoping someone can help me. I have the following function in FlashBuilder

  • 0

I am hoping someone can help me. I have the following function in FlashBuilder 4 using AS3:

protected function doIt():void
    {
        if (ExternalInterface.available) {
            var retData:String;
            retData = ExternalInterface.call("returndata");
            if(retData != null) {
                eidLbl.text = retData.toString();
            } else {
                eidLbl.text = "Returned Null";
            }
        } else {
            eidLbl.text = "External Interface not available";
        }                
    }

and the following javascript function it calls:

var fql_query = "some query format";
function returndata(){
    return fql_query;
}

When I run these from my site everything works fine! The flash file calls the javascript function and returns “some query format” into the proper text field.

However if I change my flash function to be as follows:

protected function doIt():void
{
    if (ExternalInterface.available) {
        var retData:String;
        retData = ExternalInterface.call("runFQL",uidLbl.text);
        if(retData != null) {
            eidLbl.text = retData.toString();
        } else {
            eidLbl.text = "Returned Null";
        }
    } else {
        eidLbl.text = "External Interface not available";
    }                
}

and the following javascript function:

function runFQL(id){
    var user_id = id;
    var page_id = "**********"; // the page id that is actually there is valid
    var fql_query = "SELECT uid FROM page_fan WHERE page_id="+page_id+" and uid="+user_id;

    FB.api({
        method: 'fql.query',
        query: fql_query
    },
    function(response){
        if (response[0]) {
                var uid = response[0].uid;
                window.alert(uid); //100001632043058
                return uid;
        } else {
                window.alert("return 1000");
        }
    });    
};

My problem is that when I run this one, it passes the id in, runs the query, and accurately pulls back the uid and displays it in the alert BUT (AND HERE IS MY PROBLEM) it won’t pass it back to flash in the return. It comes back as null or undefined each time.

Can anyone tell me what I am missing. I have been scouring google for hours.

  • 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-08T01:48:27+00:00Added an answer on June 8, 2026 at 1:48 am
    function(response){
        if (response[0]) {
            var uid = response[0].uid;
            window.alert(uid); //100001632043058
            return uid;
        } else {
            window.alert("return 1000");
        }
    });
    

    Is called when the FB.api function completes not when you call runFQL. So runFQL runs through and returns undefined everytime.

    What you can do is once the FB.api call completes call a function inside the flash app and pass the return value there. So basically do a ExternalInterface.addCallback in flash and call that function from javascript.

    function runFQL(id){
        var user_id = id;
        var page_id = "**********"; // the page id that is actually there is valid
        var fql_query = "SELECT uid FROM page_fan WHERE page_id="+page_id+" and uid="+user_id;
    
        FB.api({
            method: 'fql.query',
            query: fql_query
        },
        function(response){
            if (response[0]) {
                    var uid = response[0].uid;
                    window.alert(uid); //100001632043058
                    // needs ExternalInterface.addCallback("sendDataBack",handleData); in your 
                    // as3 code
                    yourSwf.sendDataBack(uid); 
            } else {
                    window.alert("return 1000");
            }
        });    
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started using SlickGrid and was hoping someone can help me solve
im hoping someone can help me quickly with a question i have. As site
I am hoping someone can help me with a question i have relating to
I am hoping someone can help me out with a quick question I have
I'm hoping someone can help on this one, I have created a custom object
I have an issue that is driving me nuts and hoping someone can help.
I have a question regarding the OnItemDataBound event and I'm hoping someone can help
Hoping someone can help. I am working on an aspx site, using the c#
I am hoping someone can help me with a css problem... I am using
I'm really hoping someone can help me out here. I have a DataGrid in

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.