Detect window closing event in AIR application

How do I detect the window closing event in an AIR app? Tried
the following.
deactivate and windowDeactivate events in the
WindowedApplication tag.
addEventListener(Event.CLOSING, onClose);
addEventListener(AIREvent.APPLICATION_DEACTIVATE onClose);
addEventListener(AIREvent.WINDOW_DEACTIVATE, onClose);
None of them seem to work.
Any ideas?
Thanks
CS

The following works for me:
<mx:WindowedApplication xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute"
closing="traceEvent(event)"
windowDeactivate="traceEvent(event)"
applicationDeactivate="traceEvent(event)">
<mx:Script>
<![CDATA[
public function traceEvent(event:Event):void{
trace(event.type);
]]>
</mx:Script>
</mx:WindowedApplication>
As does:
<mx:WindowedApplication xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute"
applicationComplete="init()">
<mx:Script>
<![CDATA[
import mx.events.AIREvent;
public function init():void{
this.addEventListener(Event.CLOSING, traceEvent);
this.addEventListener(AIREvent.WINDOW_DEACTIVATE,
traceEvent);
this.addEventListener(AIREvent.APPLICATION_DEACTIVATE,
traceEvent);
public function traceEvent(event:Event):void{
trace(event.type);
]]>
</mx:Script>
</mx:WindowedApplication>

Similar Messages

  • Closing a Swing App with Window Closing Event With Dialogs On Close

    A while back I started a thread discussing how to neatly close a Swing app using both the standard window "X" button and a custom action such as a File menu with an Exit menu item. Ultimately, I came to the conclusion that the cleanest solution in many cases is to use a default close operation of JFrame.EXIT_ON_CLOSE and in any custom actions manually fire a WindowEvent with WindowEvent.WINDOW_CLOSING. Using this strategy, both the "X" button and the custom action act in the same manner and can be successfully intercepted by listening for a window closing event if any cleanup is required; furthermore, the cleanup could use dialogs to prompt for user actions without any ill effects.
    I did, however, encounter one oddity that I mentioned in the previous thread. A dialog launched through SwingUtilities.invokeLater in the cleanup method would cause the app to not shutdown. This is somewhat of an academic curiosity as I am not sure you would ever have a rational need to do this, but I thought it would be interesting to explore more fully. Here is a complete example that demonstrates; see what you think:
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.BoxLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    public class CloseByWindowClosingTest {
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        launchGUI();
         private static void launchGUI() {
              final JFrame frame = new JFrame("Close By Window Closing Test");
              JPanel panel = new JPanel();
              panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
              JButton button1 = new JButton("No Dialog Close");
              JButton button2 = new JButton("Dialog On Close");
              JButton button3 = new JButton("Invoke Later Dialog On Close");
              button1.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        postWindowClosingEvent(frame);
              button2.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        JOptionPane.showMessageDialog(frame, "Test Dialog");
                        postWindowClosingEvent(frame);
              button3.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        SwingUtilities.invokeLater(new Runnable() {
                             public void run() {
                                  JOptionPane.showMessageDialog(frame, "Test Dialog");
                        postWindowClosingEvent(frame);
              panel.add(button1);
              panel.add(button2);
              panel.add(button3);
              frame.setContentPane(panel);
              frame.pack();
              frame.setLocationRelativeTo(null);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.addWindowListener(new WindowAdapter() {
                   @Override
                   public void windowClosing(WindowEvent event) {
                        System.out.println("Received Window Closing Event");
              frame.setVisible(true);
         private static void postWindowClosingEvent(JFrame frame) {
              WindowEvent windowClosingEvent = new WindowEvent(frame, WindowEvent.WINDOW_CLOSING);
              frame.getToolkit().getSystemEventQueue().postEvent(windowClosingEvent);
    }An additional note not in the example -- if in the button 3 scenario you were to put the window closing event posting inside the invoke later, the app then again closes. However, as implemented, what is it that causes button 3 to not result in the application closing?
    Edited by: Skotty on Aug 11, 2009 5:08 PM -- Modified example code -- added the WindowAdapter to the frame as a window listener to show which buttons cause listeners to receive the window closing event.

    I'm not sure I understand why any "cleanup" code would need to use SwingUtilities.invokeLater() to do anything. Assuming this "cleanup method" was called in response to a WindowEvent, it's already being called on the EDT.
    IIRC, my approach to this "problem" was to set the JFrame to DO_NOTHING_ON_CLOSE. I create a "doExit()" method that does any cleanup and exits the application (and possibly allows the user to cancel the app closing, if so desired). Then I create a WindowListener that calls doExit() on windowClosingEvents, and have my "exit action" call doExit() as well. Seems to work fine for me.

  • Catching window closing events from JFrame

    I'm having problems catching windowClosing() events from a JFrame (just doesn't get to my event listener it would seem!).
    I register and setup a window listener in the constructor of my JFrame class. Prior to this I set the default close operation as DO_NOTHING_ON_CLOSE (as you're suppose to if tyou want to handle window closing events).
    When user clicks on x (window terminate) button (in WIN systems), nothing is dispatched to my event listener. Any ideas?
    Extract from constructor:
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    addWindowListener(new MainWindowListener(this));
    MainWindowListener looks as follows (EDImemConvert extends JFrame):
    class MainWindowListener extends WindowAdapter
    private EDImemConvert f;
    public MainWindowListener(EDImemConvert f)
    this.f = f;
    public void windowClosing(WindowEvent e)
    System.out.println("gets here...");
    f.ReturnResources();
    f.dispose();
    System.exit(0);
    }

    This works for meimport java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test extends JFrame {
      public Test() {
        addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent we) { System.exit(0); }
        setSize(300,300);
        setVisible(true);
      public static void main(String args[]) { new Test(); }
    }Normally, I just use this line
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    instead of adding a listener. It will clean up everything nicely.

  • How to detect window close event and do some task before exiting

    Hi 
    Anyone knows how to detect window close event and do some task before exiting ?
    Sridhar
    Solved!
    Go to Solution.
    Attachments:
    window close event.JPG ‏34 KB

    Yes .You can discard the panel close event by passing "TRUE" boolean value to the "discard ?" terminal which is lied in the right side of that panel close(filter) event.& It will work in executables.  See attached picture.
    Attachments:
    Panel Close.JPG ‏12 KB

  • How to get an event on Air Application uninstallation

    Hi Friends
                     is there any way to get an event on Appliation uninstallation.Actually i want to cleared my shared object when i uninstall the application.Also want to remove the application from system tray during uninstallation of application.so please tell me any way or logic for the same.
    tell me wheather it is possible in Adobe Air or not.i am using Adobe flash builder 4 and Adobe air 2.0.Waiting for reply.
    Thanks and Regards
      Vineet Osho

    When Spry is finished displaying all (repeated) rows within spry:region you can have an notification by using an Spry.Data.Region.addObserver(). Indicating the HTML generation is finished.
    You can use spry:state for this as in
    <div spry:state="error" align="center">Error Loading Results!</div>
    <div spry:state="loading" align="center">Loading Results...</div>
    <div spry:state="ready">Data results</div>
    Is it possible (and how) to get an notification when a row within Spry.Data.Region has been processed. So I can perform some JS actions, per row in Spry.Data.Region?
    Not sure what you want to do here.
    Gramps

  • How to fire a window closing event, not clicking the X button of the UI

    I�ve an application that uses a WindowListener for the WindowClosing event of a JFrame. When the user presses CTRL-Q I needed to fire a windowClosing for that frame, in order to detect it and take some actions in the class referencig the JFrame (this class has the windowListener).
    setDefaultCloseOperation was not good for me, so i fire the windowClosing event with the following code:
    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
        WindowEvent we = new WindowEvent(this,WindowEvent.WINDOW_CLOSING, null, 0, 0);
        this.getWindowListeners()[0].windowClosing(we);
    }Hope this is the right way to fire the event and this helps someone. If not please code a better way,
    Alonso

    Yes, that works and looks better:
    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                            
       this.dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
    } "this" refers to the JFrame.

  • How to trap applet window closing event?

    Hi all,
    I would like to know how could one trap the event of the browser window containing an applet being closed by the user?
    Thank you,

    Hi. this would be useful to me too.
    Trouble is, I'm not sure that you can. applet.stop( )
    and applet.destroy( ) might be called, but there is
    no guarentee that you can complete processing before
    you are terminated, especially if you need to do
    something slow, like returning state data to your
    server. And you can't stop the broswer closing.
    I know that in Javascript, you can catch and even
    stop the browser window being closed, which is how
    things like goggledocs can ask for confirmation
    before closing. (window.onbeforeunload( ) ).
    I have toyed with the idea of having a
    javascript/ajax thread in my html, to catch this
    termination, and communicate back to the server from
    java to say a document has changed, but it all seems
    rather heavyweight for such a simple task.Look at Runtime.addShutdownHook()
    You could also try using a WindowListener as well and trap the WindowClose Event.
    stop() should do very little other than invalidate the current thread/run flags
    and then exit. ie: a stop() example
    public void stop()
    task = null;
    or
    public void stop()
    running = false;
    Your run method should look for a stop condition and then exit.
    Otherwise you could be doing stop processing while run is still
    running.
    (T)

  • Window-Closing Events

    Please, clarify the sequence. When user clicks a "cancel" button on a JDialog's descedant, I make clean up and call dispose. I've hooked hide and dispose methods of the dialog and getting the followind sequence:
    disposing
    hiding
    disposing
    hiding
    That is, hide and dispose are called twice by swing. Initially, I was considering using a hook at hide or dispose for performing a clean-up action. However, doing clean-up twice is bad idea.

    Use java.awt.WindowListener and the Window.addWindowListener method (JDialog descends from Window). From the javadoc:
    void windowClosed(WindowEvent e)
    Invoked when a window has been closed as the result of calling dispose on the window.
    void windowClosing(WindowEvent e)
    Invoked when the user attempts to close the window from the window's system menu.
    I haven't tested it to see how many times it gets called, but I would guess only once.

  • Java never detects window maximized event?

    Hello All,
    My initial problem was in trying to bring a window back to the front if a user selects the menu item that originally launched that window. I had to add extra code to handle the case where the window was minimized (iconified). Once I did that, all worked as expected, except if I maximized the window, then iconified it, then selected the menu item to redisplay it, it came up, but at the size and position it was before I maximized it. However, if I restored the iconified window by double clicking on it, it came up in its maximized state.
    Here is my basic code to redisplay the window:
    myFrame.setVisible(true);
    int state = myFrame.getExtendedState();
    if ((state & JFrame.ICONIFIED) == JFrame.ICONIFIED) {
        myFrame.setExtendedState(state & ~JFrame.ICONIFIED);
    myFrame.toFront();After investigating some more, it seems like Java never knows that the window was maximized. That is, state & JFrame.MAXIMIZED_BOTH never equals JFrame.MAXIMIZED_BOTH. Neither bits for horizontal or vertical maximized are set either. I also tried adding a WindowState listener, and the windowStateChanged method never gets called when the window is maximized. Also, the line
    myFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); does nothing.
    I am using Java 1.4.1_02 on SunOS 5.8.
    Please help! I am baffled by this behavior!
    Barb

    Hello All,
    My initial problem was in trying to bring a window back to the front if a user selects the menu item that originally launched that window. I had to add extra code to handle the case where the window was minimized (iconified). Once I did that, all worked as expected, except if I maximized the window, then iconified it, then selected the menu item to redisplay it, it came up, but at the size and position it was before I maximized it. However, if I restored the iconified window by double clicking on it, it came up in its maximized state.
    Here is my basic code to redisplay the window:
    myFrame.setVisible(true);
    int state = myFrame.getExtendedState();
    if ((state & JFrame.ICONIFIED) == JFrame.ICONIFIED) {
        myFrame.setExtendedState(state & ~JFrame.ICONIFIED);
    myFrame.toFront();After investigating some more, it seems like Java never knows that the window was maximized. That is, state & JFrame.MAXIMIZED_BOTH never equals JFrame.MAXIMIZED_BOTH. Neither bits for horizontal or vertical maximized are set either. I also tried adding a WindowState listener, and the windowStateChanged method never gets called when the window is maximized. Also, the line
    myFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); does nothing.
    I am using Java 1.4.1_02 on SunOS 5.8.
    Please help! I am baffled by this behavior!
    Barb

  • Window closeing event

    Hi all,
    I,ve created a Bank Class, that creates Atm ,s from a button in the bank
    can someone show me how to close each frame individually instead of all at once
    this is were i create the atm class
         public void actionPerformed(ActionEvent {
    if(ae.getSource( ) == b1)
    laB2.setText("Atm "+index+" now Created");
    b1.setLabel("Atm"+index);//creates atm labeled in bank     
    Atm Atm1 = new Atm(hsbc);
    //Atm1.setText("Atm"+index);
    [code\]
    Thank you very much

    Ref Above, i get the following Error,
    Hope you can Help
    Thanks Again
    public void actionPerformed(ActionEvent ae){
    if(ae.getSource( ) == b1)
    Atm Atm1 = new Atm(hsbc);
    Atm1 .addWindowListener(new vWindowAdapter()                
    public void windowClosing(WindowEvent win_eve)
    Atm1 .setVisible(false);
    [code\]
    --------------------Configuration: j2sdk1.4.0_01 <Default>--------------------
    C:\Assignment2\Ass2 Code\Assignment2.java:189: local variable Atm1 is accessed from within inner class; needs to be declared final
                                  Atm1 .setVisible(false);
                                                    ^
    C:\Assignment2\Ass2 Code\Assignment2.java:189: cannot resolve symbol
    symbol  : method setVisible  (boolean)
    location: class Assignment2.Atm
                                  Atm1 .setVisible(false);
                                                         ^
    C:\Assignment2\Ass2 Code\Assignment2.java:185: cannot resolve symbol
    symbol  : method addWindowListener  (<anonymous java.awt.event.WindowAdapter>)
    location: class Assignment2.Atm
                               Atm1 .addWindowListener(new WindowAdapter()

  • Detect wireless Internet connection in AIR application

    Hi All,
    I am facing challenges to determine whether Internet connection is available over a Wireless connection. Even if I am connected, I get the status as Not Connected.
    However the same is working absolutely find when I am connected to Wired network.
    Can any one advice how should I proceed?
    I am using the below code for tracking network connection:
         //check for network availability
         NativeApplication.nativeApplication.addEventListener(Event.NETWORK_CHANGE, onNetworkChange);
        monitor = new URLMonitor(new URLRequest('http://www.google.co.in'));
        monitor.addEventListener(StatusEvent.STATUS, announceStatus);
        monitor.start();
        requestLoader.addEventListener(Event.COMPLETE, requestCompleteHandler);
        requestLoader.addEventListener(IOErrorEvent.IO_ERROR, requestErrorHandler);              
        requestLoader.load(request);
        requestLoader.addEventListener(Event.COMPLETE, setInitStatusMsg);
    The corresponding methods have been set to set the boolean flag.
    Thanks,
    Hitesh Patel.

    Hi All,
    Thanks for your inputs.
    However I resolved the issue. The problem was with my code. I somehow missed the "requestCompleteHandler" function and hence when the request was completed the status was not refreshing. Its working fine now.
    Thanks,
    Hitesh Patel.

  • Need to detect window event for applet

    I have an applet that needs to communicate with a servlet telling the servlet to logout once the parent window (web browser) is closed. I am new to programming with GUI's involved so I apologize for any ignorance. I have been searching for an answer on solving this problem for a while and have so far been able to write a simple applet that sends a message back to the servlet once the browser is closed by implementing the stop() function -- however it sends the same message when the back button is pressed. I need to message to be sent only when the browser is closed out.

    Applets aside, there is no way to tell the server
    when the remote user closes their browser. That&#8217;s
    just one of the pits falls of web applications.
    Now, in your applet, if it's possible to catch some
    sort of window closing event when the browser closes
    (and keep in mind I don't know if this is even
    possible) then in the applets closing event you may
    be able to use a URL object to post to your Servlet.That is what I was hoping to achieve -- I had defined my own stop() method which sent out a logout request to the servlet using the URL object... but it gets called every time a new page is requested. I also tried doing this in the destroy() method after reading that stop() should be called whenever a new page is requested to pause execution and that destroy() should be called when the object is reclaimed. This does not work how I expected in IE as it gets called each time a new page is requested -- must be destroyed and recreated every time.
    In the URL you can pass some type of ID that uniquely
    identifies your user. When the Servlet receives the
    request from the applet you can parse out the ID from
    the request and invalidate the users session,
    essentially logging them out.I don't have to worry about a unique ID as this servlet only serves a single user at a time -- on first connection it locks the servlet and will report to other users that it is busy.
    One other possible solution that I just found is the
    following:
    <script language="javascript">
    window.onbeforeunload = function (evt) {
    var message = 'Are you sure you want to leave?';
    if (typeof evt == 'undefined') {
    evt = window.event;
    if (evt) {
    evt.returnValue = message;
    return message;
    </script>This JavaScript function catches the window closing
    event. From this function you would have to use the
    JavaScript XMLHttpRequest object to send an
    asynchronous request to your servlet (read up on
    AJAX). Again, in the request you would need to pass
    your ID to uniquely identify the user that you want
    to log out.I will have to look at this -- although I want to do this in an applet that does not mean that would be the only solution that exists.
    Either way it&#8217;s not going to be simple. Cheers.
    -S

  • Performing some actions before window closing in browser

    this can be done by <body onbeforeunload='delcookie()'>
    delete cookie is a javascript function where i put inthe code to delete the cookie of my page when some one closes the page or some thing else load in that window.
    this works even if window closes or some other page loads into the window. onunload can also be used it .it works in the second case only.

    Hi Sunil,
    You can retrieve the application properties in your code by:
    IWDApplicationInfo application = wdComponentAPI.getApplication().getApplicationInfo();
    String value = application.findInApplicationProperties("<property name>").getValue();
    for eg: you can retrieve expiration time as:
    application.findInApplicationProperties("sap.expirationTime").getValue();
    But expiration time is the time after which the application expires and has nothing to do with the real time
    About the application closing, as far as I know there is no event in webdynpro to capture the window closing event. So it depends on how the user closes the application. If he closes the application from within it using some button or link, then you can very well write the required code there. If he closes the browser directly, then I don't think you can handle that.
    Hope this helps,
    Best Regards,
    Nibu.

  • Frame window closing

    Hi friends,
    please help me in following situation.
    I have a frame1, where i have a button to open new frame2. this frame 2 opens some other frames.
    When i close main frame1, i want to trigger a event or execute a method on other frames. i tried window closing and window closed events from frame1 or frame2.
    frame2 and frame3 windows r just closing without any events when i close main frame1.
    frame2 and frame3 must extend JFrame not JDialog.
    thanks,

    make in each frame a lille method that calls the next frame (if there is one) and waits until he gets something in return...
    so 1 calls 2, 2 calls 3....
    3 is the last frame and shuts itself down, but first it returns a value to 2.
    then 2 knows it can return a value to 1 and closes itself...
    that's the thing i would do... but never tried it yet so dunno about the speed it goes....
    leme know if I helped you out.
    SeJo

  • FLV Playback and Seekbar on different native windows in one Air application

    Hello Everyone.  I'm trying to make a simple video playback AIR application that utilizes the initial native window to house a transport control with a seekbar on it.  Once the application launches, it creates a second (new) window on my second screen and places a FLVPlayback instance on that new window.  Everything works just like it want it to except for one thing.  When the seekbar and FLVplayback instance are not located on the same window stage, the seekbar handle sticks to the mouse when trying to scrub through the video.
    I've added both the transport control and the FLVPlayback instance to the original native window as children and I have also added both of them to the new window as children and everything works just fine.  It's only when they are separated and located on different stages that the seekbar acts up.  When they are on the same stage, I can click on a point on the seekbar and the video jumps to that spot and continues to play and I can also scrub the seekbar, the video updates as I scrub, and when I release the mouse, the seekbar handle stays where I released the mouse.  When they on separate stages, the seekbar handle continues to follow the mouse movement without releasing it.  The video updates as the seekbar handle is moved due to it sticking to the mouse, but if I release the mouse, the handle is still moving with the mouse and the video is still being scrubbed.  Like I said, everything works great except for this and I have reached my limit with time spent on this issue.  Does anyone have any insight into this?
    Here's my code for the project.  This is my first AIR application, so I am coding it as I am learning, please be kind.
    import fl.video.*;
    import flash.display.*;
    import flash.desktop.*;
    import flash.events.*;
    import fl.video.MetadataEvent;
    import flash.geom.*;
    import flash.ui.Mouse;
    import flash.text.*;
    GLOBAL SETUP
    var flvControl:FLVPlayback;
    var MasterWindow = stage.nativeWindow;
    var screen1:Screen = Screen.screens[0];
    var screen2:Screen = Screen.screens[1];
    MASTER WINDOW SETUP
    this.loaderInfo.addEventListener(Event.COMPLETE,maximize);
    transControl.playPauseButt2.addEventListener(MouseEvent.CLICK, PlayButton);
    if (Screen.screens.length > 1){
              createVideoBKG();
              createVideoPlayer();
    GENERAL FUNCTIONS
    //Maximize the initial screen
    function maximize(e:Event) {
              MasterWindow.x = screen1.bounds.left
              MasterWindow.maximize();
              MasterWindow.stage.scaleMode = StageScaleMode.EXACT_FIT;
    //Hide Mouse Behind Video Window On Roll-Over
    function MouseRollOver(e:MouseEvent):void
              {          Mouse.hide()          }
    function MouseRollOut(e:MouseEvent):void
              {          Mouse.show()          }
    //Play-Pause Button Control
    function PlayButton(event:MouseEvent):void
                        if(transControl.playPauseButt2.currentFrame==1 ){
                                  transControl.playPauseButt2.gotoAndPlay(2);
                                  flvControl.play();
                        else {
                                  transControl.playPauseButt2.gotoAndPlay(1);
                                  flvControl.pause();
    function CloseWindow(e:MouseEvent):void
                        NativeApplication.nativeApplication.openedWindows[2].close();
    VIDEO BKG SETUP
    function createVideoBKG(e:Event = null):void{
              var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
              newOptions.type = NativeWindowType.LIGHTWEIGHT;
              newOptions.systemChrome = NativeWindowSystemChrome.NONE;
              newOptions.transparent = true;
              var videoBKG:NativeWindow = new NativeWindow(newOptions);
              if (Screen.screens.length > 1){
                        videoBKG.x = screen2.bounds.left;
              videoBKG.maximize();
              chromeSetup(videoBKG);
              videoBKG.activate();
    //Video BKG Chrome Setup
    function chromeSetup(currentWindow):void {
              var vidBKG = new video_bkg();
              vidBKG.name = "video_bkg2";
              vidBKG.addEventListener(MouseEvent.ROLL_OVER, MouseRollOver);
              vidBKG.addEventListener(MouseEvent.ROLL_OUT, MouseRollOut);
              currentWindow.stage.addChild(vidBKG);
    VIDEO Player SETUP
    function createVideoPlayer(e:Event = null):void{
              var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
              newOptions.type = NativeWindowType.LIGHTWEIGHT;
              newOptions.systemChrome = NativeWindowSystemChrome.NONE;
              newOptions.transparent = true;
              var videoPlayer:NativeWindow = new NativeWindow(newOptions);
              if (Screen.screens.length > 1){
                        videoPlayer.x = screen2.bounds.left;
                        videoPlayer.y = screen2.bounds.top;
                        videoPlayer.width = screen2.bounds.width;
                        videoPlayer.height = screen2.bounds.height;
                        videoPlayer.stage.scaleMode = StageScaleMode.NO_SCALE;
              videoPlayer.alwaysInFront = true;
              var DVR = new DVR_Player();
              DVR.name = "DVR";
              DVR.x = 0;
              DVR.y = 0;
              DVR.addEventListener(MouseEvent.ROLL_OVER, MouseRollOver);
              DVR.addEventListener(MouseEvent.ROLL_OUT, MouseRollOut);
              videoPlayer.stage.addChild(DVR);
                flvControl = DVR.display2;
              flvControl.width = 1280;
              flvControl.height = 720;
              flvControl.skin = null;
              flvControl.autoPlay=false;   
              flvControl.isLive=false;
              flvControl.fullScreenTakeOver = false;
              flvControl.align = VideoAlign.CENTER;
              flvControl.scaleMode = VideoScaleMode.NO_SCALE;
              flvControl.source = "olympics.f4v";
              flvControl.seekBar = transControl.seekbarContainer2.seeker;
              videoPlayer.activate();

    Does anyone have any ideas about this?

Maybe you are looking for