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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:16:16+00:00 2026-06-06T06:16:16+00:00

I have a flex application with an iframe layered on top. I want to

  • 0

I have a flex application with an iframe layered on top.

I want to make a call from the iframe to flex with javascript.

So far i have tried this:

This is the Object containing the swf embed in the ROOT document

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
        id="IPRS_Dispatcher" width="1400" height="1000"
        codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
        <param name="movie" value="DispatcherMain.swf" />
        <param name="quality" value="high" />
        <!-- <param name="bgcolor" value="${bgcolor}" /> -->
        <param name="allowScriptAccess" value="sameDomain" />
        <param name='flashVars' value='strLang=english&strIPRSSrvHost=&strGPSSrvHost=192.168.1.130&strGPSSrvSoapPort=8081&strGPSSrvFwdPort=26000&strLoginMode=simple&strSOSSrvHost=192.168.1.80&strSOSSrvSoapPort=8082&strSOSSrvFwdPort=26001&strSOSLoginMode=simple&strUserSIP=&strUserPswd=&nDelayForMapReadySecs=10&nGPSUpdatesRateSecs=120&nGPSSubscriptionsIntervalMinutes=10&nLat=35.0&nLng=32.5&nZoomLevel=5&strClientServiceVersion=2.1.36.19&nPathDotsSize=1&nPathWidth=5&bHideAnnounce=false&bHideEmergencyPan=true&strMapMarkerLabelMode=name&key=ABQIAAAAYbXZyR09wFj6QsiYucHpGxQEO34WZEWuIFq1A7yobGXPE-K5exQV9ZYR6NIkF8LCR8wsYvlhOIYsfA' />
        <embed id="IPRS_Dispatcher2" src="DispatcherMain.swf"
            flashVars='strLang=english&strIPRSSrvHost=&strGPSSrvHost=192.168.1.130&strGPSSrvSoapPort=8081&strGPSSrvFwdPort=26000&strLoginMode=simple&strSOSSrvHost=192.168.1.80&strSOSSrvSoapPort=8082&strSOSSrvFwdPort=26001&strSOSLoginMode=simple&strUserSIP=&strUserPswd=&nDelayForMapReadySecs=10&nGPSUpdatesRateSecs=120&nGPSSubscriptionsIntervalMinutes=10&nLat=35.0&nLng=32.5&nZoomLevel=5&strClientServiceVersion=2.1.36.19&nPathDotsSize=1&nPathWidth=5&bHideAnnounce=false&bHideEmergencyPan=true&strMapMarkerLabelMode=name&key=ABQIAAAAYbXZyR09wFj6QsiYucHpGxQEO34WZEWuIFq1A7yobGXPE-K5exQV9ZYR6NIkF8LCR8wsYvlhOIYsfA' 
            width="1400" height="1000" name="IPRS_Dispatcher" align="middle"
            play="true"
            loop="false"
            quality="high"
            allowScriptAccess="sameDomain"
            type="application/x-shockwave-flash"
            pluginspage="http://www.adobe.com/go/getflashplayer"> <!-- bgcolor="${bgcolor}" -->
        </embed>
</object>

I have added addcallback for the function i want to expose

ExternalInterface.addCallback("sendToFlash", callFromJavaScript);

FYI

  public function callFromJavaScript(str):void
  {
  LogAddItem( 30, str);
  }

In my IFRAME i have added the function

function callToFlash(str) 
{
  var swf = parent.top.$("#IPRS_Dispatcher");
  var bool = swf.sendToFlash(str);
}

Now getting error in chrome – Uncaught TypeError: Object [object Object] has no method ‘sendToFlash’

UPDATE 25/06/2012 – output from console.log(swf)

[
<embed src=​"DispatcherMain.swf" width=​"100%" height=​"100%" align=​"middle" id=​"IPRS_Dispatcher" quality=​"high" name=​"IPRS_Dispatcher" wmode=​"opaque" allowfullscreen=​"true" allowscriptaccess=​"always" pluginspage=​"http:​/​/​www.adobe.com/​go/​getflashplayer" flashvars=​"strOEM=mt&strSplashImage=./​assets/​loadinglogo.jpg&strLang=english&strSelectableLangs=english,chinese, portuguese_brazil,german,french,spanish&strIPRSSrvHost=85.118.26.10&strGPSSrvHost=85.118.26.16&strGPSSrvSoapPort=8081&strGPSSrvFwdPort=26000&strLoginMode=simple&strUserSIP=&strUserPswd=&strSOSSrvHost=85.118.26.17&strSOSSrvSoapPort=8082&strSOSSrvFwdPort=26001&strClientServicePort=&strSOSLoginMode=simple&themeColor=a7c3e3&showRTTPriority=false&showGPSUpdateRate=true&nSamePosErrMeters=300&nDelayForMapReadySecs=10&nGPSUpdatesRateSecs=65535&nGPSSubscriptionsIntervalMinutes=10&nLat=48.311058&nLng=11.636753&nZoomLevel=13.0&strClientServiceVersion=2.1.36.04&bDispatcherEndsSessions=true&nSOSSubscriptionsIntervalMinutes=1&GPSKATime=20&SOSKATime=20&nPathDotsSize=2&nPathWidth=5&bHideAnnounce=false&bHideEmergencyPan=false&bHideDebugLog=false&showMutedColumn=false&strLogFilter=&strMapMarkerLabelMode=name&key=ABQIAAAAfJEcVYS6-jYp2UOUy8Wh5xSCeXAFBxztfWxjY5w1WzTnKjnSVRS7Uu5XoOIwTg2R_tq_c0QSCPxSHw" type=​"application/​x-shockwave-flash">​
] 
  • 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-06T06:16:17+00:00Added an answer on June 6, 2026 at 6:16 am

    Can you run please:

    function sendToActionscript(str) 
    {
      var swf = jQuery("#IPRS_Dispatcher", parent.document);
      console.log('step1');
      console.log(swf);
      console.log('step2');
      console.log.(swf.html());
      console.log('step3');
    
      swf.LogAddItem(30, str);
      console.log('step4');
    }
    

    Okay, next debug step: run this:

    function sendToActionscript(str) 
    {
      var swf = parent.top.$(“#IPRS_Dispatcher”);
      console.log('step1');
      console.log($);
      console.log('step2');
      console.log.(jQuery);
      console.log('step3');
      console.log(parent.document);
      console.log('step4');
    }
    

    EDIT

    STEPS OUTPUT

    step1 
    function (j,s){return new b.fn.init(j,s)} iframecontent.html:49
    step2 
    [
    <embed src=​"DispatcherMain.swf" width=​"100%" height=​"100%" align=​"middle" id=​"IPRS_Dispatcher" quality=​"high" name=​"IPRS_Dispatcher" wmode=​"opaque" allowfullscreen=​"true" allowscriptaccess=​"sameDomain" pluginspage=​"http:​/​/​www.adobe.com/​go/​getflashplayer" flashvars=​"strOEM=mt&strSplashImage=./​assets/​loadinglogo.jpg&strLang=english&strSelectableLangs=english,chinese, portuguese_brazil,german,french,spanish&strIPRSSrvHost=85.118.26.10&strGPSSrvHost=85.118.26.16&strGPSSrvSoapPort=8081&strGPSSrvFwdPort=26000&strLoginMode=simple&strUserSIP=&strUserPswd=&strSOSSrvHost=85.118.26.17&strSOSSrvSoapPort=8082&strSOSSrvFwdPort=26001&strClientServicePort=&strSOSLoginMode=simple&themeColor=a7c3e3&showRTTPriority=false&showGPSUpdateRate=true&nSamePosErrMeters=300&nDelayForMapReadySecs=10&nGPSUpdatesRateSecs=65535&nGPSSubscriptionsIntervalMinutes=10&nLat=48.311058&nLng=11.636753&nZoomLevel=13.0&strClientServiceVersion=2.1.36.04&bDispatcherEndsSessions=true&nSOSSubscriptionsIntervalMinutes=1&GPSKATime=20&SOSKATime=20&nPathDotsSize=2&nPathWidth=5&bHideAnnounce=false&bHideEmergencyPan=false&bHideDebugLog=false&showMutedColumn=false&strLogFilter=&strMapMarkerLabelMode=name&key=ABQIAAAAfJEcVYS6-jYp2UOUy8Wh5xSCeXAFBxztfWxjY5w1WzTnKjnSVRS7Uu5XoOIwTg2R_tq_c0QSCPxSHw" type=​"application/​x-shockwave-flash">​
    ] 
    step3 iframecontent.html:52
    #document
    step4 
    

    okay,so now simply try

    function sendToActionscript(str) 
    {
      var swf = parent.top.$(“#IPRS_Dispatcher”);
      swf.LogAddItem(30, str);
    }
    

    there is an error in your flex app
    enter image description here

    Finally Resolved

        // get flash movie object
    var flashMovie;
    function init() {
       if (document.getElementById) {
          flashMovie = parent.document.getElementById("IPRS_Dispatcher");
       }
    }
    
    // wait for the page to fully load before initializing
    window.onload = init;
    
    function callToFlash(str) 
    {
      var bool = flashMovie.sendToFlash(str);
    }
    

    I think waiting for the page to fully load before initializing was the fix.

    You can also use http://api.jquery.com/ready/

    $(document).ready(init);
    

    to get it working after DOM initialisation.

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

Sidebar

Related Questions

I have an Adobe Flex application that needs to call C++ functions from a
I have a portlet. Inside of this portlet I have Flex application that displays
I have a view like this in my Flex mobile Application: <s:View xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark
I have a Flex application, I want to scroll the page to bottom when
I have a flex application and I want to add a new custom component
I have a flex application which use DragManager. When I'm loading this application into
I have a flex application, running with amfphp and connected to wamp, I want
I have a flex 3 application that creates an Image from a canvas which
I have Flex 4 application in which I have one component as top layer
I have a Flex application which is served via a JSP page. In this

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.