1 Reply Latest reply on Jan 3, 2012 2:23 PM by jordana309-36

    Talking to a new window

    jordana309-36

      I'm going from an Flex AIR app in which I load a control interface (has buttons and such), which opens a new window to play videos. The control screen talks frequently with the video screen throughout program operation. We have recently run into poor video playback quality (dropped frames, etc). So, I'm trying to impliment StageVideo, which seems to not be possible in an AIR application. So, I'm trying it as a web app, but I can't figure out how to open a new window, move that window to a second screen, make it full screen, and then talk to it from the first screen. I have been able to open a new window using something similar to this piece of code found on the internet:

      public function sendToJavaScript():void {

              var win:Object = new Object();

              win.url = winUrl.text;

              win.name = winName.text;

              win.height = winHeight.text;

              win.width = winWidth.text;

              ExternalInterface.call("openWindow",win);

        }

       

      But that doesn't really help me with what I need.

       

      So, my question is this: how do I get stage video to work in an AIR application OR how do I get this stuff working well on the web?

        • 1. Re: Talking to a new window
          jordana309-36 Level 1

          sorry, I opened new windows using the following code. The above code was a failed attempt:

              var src:String = "someplaceOnline";

              var urlReq:URLRequest = new URLRequest(src);

              navigateToURL(urlReq, "_blank");

           

          Also, after playing with this all day, I found that I can open a window, but it's not the SWF in a browser...I am trying to open an instance of an MXML component, which in my AIR version was a Window. And I still can't seem to talk to the window after it has been created...what pieces am I missing?

           

          Sorry, a lot of rookie mistakes. I needed to reference the correct document. I found the solution to my problem is called the AjaxBridge. When I right-click and add the AjaxBridge, I get the files I need to make it work, and I noticed that the html file embedded the SWF that's in my debutOutput folder. when I referenced this HTML file, it seemed to fix the opening issue.

           

          However, I find it still not possible to get the two windows to talk. Does anybody know how to reference another window's JavaScript through AjaxBridge?

           

          Partial solution: AjaxBridge. New Problem: Can't get the two windows JS code to talk to each other.