Can I Capture Javascript Calls from a Loaded SWF?

My scenario:
My main movie (SWF A) loads another movie (SWF B) and plays it.
SWF B is legacy content - I can't modify it.
SWF A is AS3. SWF B might be AS2 or AS3
SWF B makes several calls to a javascript function that would normally reside in the hosting web page.
The javascript calls might use ExternalInterface, or they might use getURL(javascript: xxx) or they might even use fscommand.
My questions:
Is there any way I can intercept the javascript call in movie A? I don't want to have to resort to the browser, so simply using ExternalInterface or similar to pipe the request back into the movie won't work.
If there is a way, how does it vary across the different versions (ie. what's the difference between the child movie being AS2 or AS3, and what's the difference between the various means of calling js?
I'm working on a web deployment, using Flex 4.0. I would be interested also in whether this is possible in Air, or Air Mobile.
Many thanks in advance for any replies.
JcFx
http://www.jcfx.eu

no, not with all those constraints.

Similar Messages

  • Can't target main stage from dynamically loaded swf...

    A part of the Flash app. I'm working on right now does the following -
    Main stage loads an external swf using the following function:
    function loadAsset(evt:String):void{
    var assetName:String = evt;
    if (assetName != null){
      var assetLdr:Loader = new Loader(); 
      var assetURL:String = assetName; 
      var assetURLReq:URLRequest = new URLRequest(assetURL); 
      assetLdr.load(assetURLReq); 
      assetLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded) 
      assetLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayAssetLoaderProgress);  
      function loaded(event:Event):void { 
       var targetLoader:Loader = Loader(event.target.loader); 
       assetWindow.addChild(targetLoader);
    The externally loaded swf loads another external swf into itself using the following function:
    function loadQuiz(evt:String):void{   
    var quizName:String = evt;
    if (quizName != null){
      var quizLdr:Loader = new Loader();
      var quizURL:String = quizName;
      var quizURLReq:URLRequest = new URLRequest(quizURL);
      quizLdr.load(quizURLReq);
      quizLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded)       
      quizLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayQuizLoaderProgress); 
      function loaded(event:Event):void {
       var targetLoader:Loader = Loader(event.target.loader);
       quizWindow.assetLoader.addChild(targetLoader);     
    Everything loads fine, but from the quizWindow.assetLoader.addChild(targetLoader) level, I want to send a message/fill in a dynamic text box on the Main Stage. I have been "parenting" my brains out and I'm not sure how to communicate with that level.
    can anyone show me the proper path or method based off the above, or have a suggestion?
    Cheers,
    ~Chipleh

    Andrei1,
    Thanks again for your help. I was finally able to get the solution you posted below to work for me.
    Much appreciation,
    ~Chipleh
    "In your loaded movie write:
    function traceMyself(e:MouseEvent):void{
         dispatchEvent(new Event("I_WANT_TEXT"));
    function writeText(text:String):void {
         xmlFileName1.text = text;
    In the top movie that loads external swfs something like that:
    loadedSwf.addEventListener("I_WANT_TEXT", onTextRequest, true);
    function onTextRequest(e:Event):void {
         Object(e.target).writeText(tQuizXmlFile1.theQuizXmlFile.text);
    This way these two entities are independent and, most importantly, don't care who is the parent or grandparent."

  • Calling a function in a flex app from a loaded SWF

    How can I call a function in a flex application from a loaded
    swf file?

    Two ways:
    Application.application returns a reference to the top-level
    application scope. You can access any public member, var, function,
    component, etc through that reference.
    Dispatch an event event form the loaded swf and use a event
    handler in the main app. All the gurus advise this as best
    practice, to ensure "loose coupling" It is also pretty easy,
    especially if you use a bubbling event.
    Tracy

  • How Can I make redirect caller from agent to any branch IVR?

    I have IPCC Enterprise Edition (ICM 5.0, IVR 3.1)
    How can I make redirect caller from agent to chosen branch IVR, and send with call any variable to IVR (e.g. account number).
    Regards
    Krzysztof

    I would suggest that post-routing should not be used. The way to go is to use translation routing applications. Although post-routing is easy to set up, almost all deployments require translation routing. I can't think of anything good to say about post routing, other than it's trivial to configure.
    You want the main route point to be on the CM_PIM.RC for a number of reasons. You can check to see which of your IVRs are on line, and/or to do load balancing. If calls don't need to go to the IVR if agents are ready, you can have an LAA Select node immediately, and then translation route. Even if you just have one IVR, translation routing will enable you to do RONA more easily.
    You need to bite the bullet and learn translation routing. If you do it that way, peripheral variables attached to the call remain unaffected whether the call is under the control of the CM_PIM.RC or the IVR_PIM.RC. This is exactly what you want.
    There is no need, in my opinion, to go to an external database. In your IVR, decisions made by the caller (e.g. which "skill" they want) set peripheral variables. When the call comes out of this script you check the peripheral variable, and depending on the value do a queue to the appropriate skill group and run external script (BasicQ.aef).
    Separate the intelligence gathering IVR script from the Queuing script. Allow ICM to make the routing decisions.

  • How can I make a call from iPad

    How can I make a call from IPad

    Oh, you have to get the iPhone app.
    Seriously, though .... you are aware that it's not a telephone, right? Any calls you make will be using VOIP and any of the apps and/or services (Skype, Google Talk, etc., etc.) which support that. Some of those are US-only, all have various restrictions and cost structures.

  • Can I capture the video from the TV card or video capture card to publish

    Can I capture the video from the TV card or video capture card to publish?
    I tried to use the USB camera, it's OK. But, will the TV card or video capture card also work?

    Hi,
    iChat will set up a Video chat window that takes in to account your Processor speed and Internet Speed and to some extent the Buddy's speed.
    This then denotes the pixel content of each frame.
    OS X 10.6.x tells me this is iChat 5 which in turn mean you have  at least an Intel Core 2 Duo Processor.
    This should be capable of 30 frames a sec at  about 640 X 480 pixels  (Check the Connection Doctor (Video Menu) and the Statistics tab during a Chat).
    iChat 5 cannot do HD  (Max of 4:3 ratio at the above figures)
    After that it depends how you are recording the chat.
    Quicktime X would do it.
    iChat will do it itself (if the Buddy agrees)
    10:14 PM      Wednesday; February 1, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Calling a function in the main movie from a loaded swf

    I realize this is probably a very basic question, but I have
    loaded a SWF file into another movie. I now want to call a function
    in the main SWF. Is there a way to do that? Alternatively, I have a
    custom class where I could put the function, but I haven't been
    able to figure out how to call it from the loaded SWF either. Do I
    somehow need to associate the class with the main movie,
    or...?

    Never mind - I was doing something very stupid and wasn't
    calling the function as a method of a movie clip. I was simply
    calling checkTarget(event) rather than
    event.currentTarget.checkTarget(event); which seems to work.

  • How can i hide incoming calls from showing on my screen

    How can I stop incoming calls from showing on my home screen?

    If you just don't want to see the call notification on your home screen go to Settings, Notification, Phone and turn Notification Center to Off.  Or you can simply select None and calls will be listed in the Notification center but you won't see a banner / alert on the home screen.
    This also eliminates the Caller ID from being displayed before you answer the call.

  • Can you capture images directly from a fuji camera - Fine Pix S2pro

    can you capture images directly from a fuji camera -- Fine Pix S2pro or Fine Pix S2pro to a imac running 10.6.5
    camera tethered to the imac

    Page 76. Thanks!!!
    You can quickly open Camera when the screen is locked by double-clicking the Home button, then tapping          .

  • I can´t connect Facetime calls from my Imac or Macbook pro, i can only make it from my iphone 4. why is that? in my imac and macbook pro i have OS X 10.8.5

    I can´t connect Facetime calls from my Imac or Macbook pro, i can only make it from my iphone 4. why is that? in my imac and macbook pro i have OS X 10.8.5

    FaceTime for Mac: Troubleshooting FaceTime - Apple Support

  • I am facing problem in using viber...can not receive  any call from Viber whn keypad is locked and whn i unlock phone thn on opening viber i can see the missed call notification... kindly guide me there is any setting so0 tht i can receive viber calls

    I am facing problem in using viber...can not receive  any call from Viber whn keypad is locked and whn i unlock phone thn on opening viber i can see the missed call notification... kindly guide me there is any setting so0 tht i can receive viber calls whn my phone is locked even as i can receive calls on HTC

    Hi,
    This is an official representative of Viber Media.
    Unfortunately we cannot change this feature due to Apple's restrictions. :/
    For more questions or technical support, please visit our official HelpDesk.
    Thanks,
    Viber

  • I recieve phone call from my iphone on my mac  but i can not make a call from my mac

    I recieve phone call from my iphone but i can not make a call from my mac What shall ido

    Then follow the steps here:
    Connect your iPhone, iPad, iPod touch, and Mac using Continuity - Apple Support
    But basically make sure that iCloud is enabled with the same account in both your Mac and iPhone, turn off Wi-Fi calls if enabled in your iPhone and make sure that Facetime has the same accounts in your devices.

  • I recieve phone call from my iphone but i can not make a call from my mac

    I recieve phone call from my iphone but i can not make a call from my mac What shall i do

    Hello alireza.s,
    The article linked below details a number of steps that can help restore your iPhone's ability to make phone calls.
    iPhone: Troubleshooting issues making or receiving calls
    http://support.apple.com/en-us/TS3406
    Cheers,
    Allen

  • HT5176 How can I make a call from my new iPad(3rd generation) with wifi+4G

    How can we make a call from iPad 3rd generation with wifi+4G?

    You cant "Call" anyone. Its not a phone. You can facetime other IOS users. Setup facetime with your apple id in ipad settings/facetime. You can also download apps like skype in the app store.

  • I can't make a call from my IPhone when I call it is showing as call back

    I can't make a call from my IPhone when I call it is showing as call back

    Hello alireza.s,
    The article linked below details a number of steps that can help restore your iPhone's ability to make phone calls.
    iPhone: Troubleshooting issues making or receiving calls
    http://support.apple.com/en-us/TS3406
    Cheers,
    Allen

Maybe you are looking for