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 5843667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:11:10+00:00 2026-05-22T12:11:10+00:00

So my team’s project has an swf embedded in JavaScript, we’re actually using java

  • 0

So my team’s project has an swf embedded in JavaScript, we’re actually using java servlet’s to create the html/JavaScript. I am attempting to use as3’s ExternalInterface to add a callback which would get called in the javascript but everything I have tried will not work.

Here is some of the related code:

Javascript:(remember using servlets thats why this is all inside a string)

<html>
<head>
    <script src='/oddmanor/AC_OETags.js' language='javascript'></script>
    <script language='JavaScript' type='text/javascript'>
        var requiredMajorVersion = 10;
        var requiredMinorVersion = 1;
        var requiredRevision = 0;
    </script>
</head>
<body marginwidth='0' marginheight='0' leftmargin='0' topmargin='0'>
    <script language='JavaScript' type='text/javascript'>
    var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
    if (hasReqestedVersion) {
        AC_FL_RunContent(
            'src', 'http://localhost:8080/download/FlashClient',
            'width', '760',
            'height', '600',
            'align', 'middle',
            'id', 'myswf',
            'quality', 'high',
            'bgcolor', '#FFFFFF',
            'name', 'myswf',
            'allowScriptAccess','always',
            'type', 'application/x-shockwave-flash',
            'codebase', 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
            'pluginspage', 'http://www.adobe.com/go/getflashplayer',
            'wmode', 'opaque',
            'flashvars', 'challenge=c0oC5CjXjOpRagA0Eh0xi2uYCv-8HZfz-XpG2CCmJHZMnFQK8wYI4kultTUGYGff3N8-5lco_TrR2MfCvnUhVUyCOII6Xtem2rRIPD3SBJ18YxUSkH2GykI78Im2pfqw-UR44OqlOuZGafL3VRkn7KSiMm-AWbZt60MFHzHFaeEhIQke9aj04UkmaJL1MWoOU4CklVxoqX-ag146KilHEroL46JxcD9TLvCW9MG_Gv9fTAYOZK2_FEsHUMg0kP8WjyheWBftNxOuZoHQ9bIsB9EDe9pR4RwZryCjyL6p4T7Si0dMFfmEvml5mkhRYG74yj7pLDKTgHJeURUKOYY9RU9mFbsA82Q8-7cXeGlvQnk'
        );
    } else {
        var alternateContent = 'Alternate HTML content should be placed here.<BR>'
        + 'This content requires the Adobe Flash Player. '
        + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
        document.write(alternateContent);
    }

    </script>
    <noscript>
    <div align="middle" id="swf">
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
    <param name="src" value="http://localhost:8080/download/FlashClient">
    <param name="width" value="760">
    <param name="height" value="600">
    <param name="align" value="middle">
    <param name="id" value="myswf">
    <param name="quality" value="high">
    <param name="bgcolor" value="#FFFFFF">
    <param name="name" value="myswf">
    <param name="allowScriptAccess" value="always">
    <param name="type" value="application/x-shockwave-flash">
    <param name="codebase" value="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
    <param name="pluginspage" value="http://www.adobe.com/go/getflashplayer">
    <param name="wmode" value="opaque">
    <param name="flashvars" value="challenge=c0oC5CjXjOpRagA0Eh0xi2uYCv-8HZfz-XpG2CCmJHZMnFQK8wYI4kultTUGYGff3N8-5lco_TrR2MfCvnUhVUyCOII6Xtem2rRIPD3SBJ18YxUSkH2GykI78Im2pfqw-UR44OqlOuZGafL3VRkn7KSiMm-AWbZt60MFHzHFaeEhIQke9aj04UkmaJL1MWoOU4CklVxoqX-ag146KilHEroL46JxcD9TLvCW9MG_Gv9fTAYOZK2_FEsHUMg0kP8WjyheWBftNxOuZoHQ9bIsB9EDe9pR4RwZryCjyL6p4T7Si0dMFfmEvml5mkhRYG74yj7pLDKTgHJeURUKOYY9RU9mFbsA82Q8-7cXeGlvQnk">
    <embed src="http://localhost:8080/download/FlashClient" width="760" height="600" align="middle" id="myswf" quality="high" bgcolor="#FFFFFF" name="myswf" allowScriptAccess="always" type="application/x-shockwave-flash" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="opaque" flashvars="challenge=c0oC5CjXjOpRagA0Eh0xi2uYCv-8HZfz-XpG2CCmJHZMnFQK8wYI4kultTUGYGff3N8-5lco_TrR2MfCvnUhVUyCOII6Xtem2rRIPD3SBJ18YxUSkH2GykI78Im2pfqw-UR44OqlOuZGafL3VRkn7KSiMm-AWbZt60MFHzHFaeEhIQke9aj04UkmaJL1MWoOU4CklVxoqX-ag146KilHEroL46JxcD9TLvCW9MG_Gv9fTAYOZK2_FEsHUMg0kP8WjyheWBftNxOuZoHQ9bIsB9EDe9pR4RwZryCjyL6p4T7Si0dMFfmEvml5mkhRYG74yj7pLDKTgHJeURUKOYY9RU9mFbsA82Q8-7cXeGlvQnk" />
    </object>
        This content requires the Adobe Flash Player and a browser with JavaScript enabled.
        <a href='http://www.adobe.com/go/getflash/'>Get Flash</a>
    </div>
    </noscript>
    <div>
        <a href='http://d1fjc9whyjwawe.cloudfront.net/KingX_Studios_Terms_of_Service.pdf' TARGET='_blank'>KingX Terms of Service</a> | 
        <a href='http://d1fjc9whyjwawe.cloudfront.net/Privacy_Policy_Odd_Manor.pdf' TARGET='_blank'>Privacy Policy</a> | 
        <a href='http://www.activeboard.com/forum.spark?aBID=138536&topicID=42164567&p=3' TARGET='_blank'>Report a Bug</a>
    </div>
    <div id='fb-root'></div>
    <script src='http://connect.facebook.net/en_US/all.js'></script>
    <script type='text/javascript'>
        FB.init(
            {
                'appId': '191461020878253',
                'status': true,
                'cookie': true,
                'channelUrl': 'http://nimbus.com:8080/oddmanor/fb_channel.html'
            }
        );

        var callback = function(data) {
            var res;
            if (data['order_id']) {
                res = true;
            }
            else {
                res = false;
            }
            var me;
            if (navigator.appName.indexOf('Microsoft') != -1) {
                me = window['myswf'];
            }
            else {
                me = document['myswf'];
            }
            me.onPurchaseCompletion(res);
        };

        function getFlashMovie(movieName) {
           var isIE = navigator.appName.indexOf("Microsoft") != -1;
           return (isIE) ? window[movieName] : document[movieName];  }

        function getFriendsUsingApp() 
        {
            alert("ALERRRRRT!!!");
            getFlashMovie("myswf").passFriendArrayToFlash();
            return "set2";
        }

        function makePurchase(objectInfo) {
            var obj = {
                'method': 'pay',
                'order_info': objectInfo,
                'purchase_type': 'item'
            };

            FB.ui(obj, callback);
        }
    </script>
</body>
</html>

Also I ripped out a bit of JavaScript code that didnt have anything to do with this problem(hopefully) so if there is a missing tag or something that’s probably not my problem.

NOTE I embed this correctly and get into the swf allowing it to call javascript functions(as3 calls the getStuff fn), using the ExternalInterface, which works but JS->as3 does NOT work ='(.

Other notes,
FlashClient is the name of the swf….

I cant use the movie object for anything (the return value of getFlashMovie), if I try to use no code after works…

The action script code calls the external interface addCallback function correctly(called in a try catch that’s how I know)
if(External…Availible)
External…addCallback(“passStuff”, as3PassStuff)

The only things I can think of;
1) The embed code isnt creating the object correctly, since I cant use the movie for anything
2) my swf is being created weird and doesnt allow script access.

We are using FlashBuilder to build the swf.

  • 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-05-22T12:11:11+00:00Added an answer on May 22, 2026 at 12:11 pm
    System.security.allowDomain("*");
    

    in my swf and we’re good.

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

Sidebar

Related Questions

My team has been using SVN for a few years. We now have the
A team that I am working on has gotten into the habit of using
Our team has been testing our application with Selenium as it's heavily JavaScript driven
Our team trying to create a windows application(c#) to call a WCF service using
Our team has built a site using Sharepoint and a few custom webparts. We've
My team created a project. This project has already existed on each PC of
Our team develops distributed winform apps. We use ClickOnce for deployment and are very
My team has a command parsing library for console apps. Each team around us
My team uses SVN for our software platform, and we create tags periodically to
Our team is willing to unit-test a new code written under a running project

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.