Access WindowedApplication from package class.
        Posted  
        
            by Senling
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Senling
        
        
        
        Published on 2010-05-20T05:15:41Z
        Indexed on 
            2010/05/20
            5:20 UTC
        
        
        Read the original article
        Hit count: 217
        
Hi, I'm developing an AIR application, where i need to access WindowedApplication's function from the package class.
This is the Main application (Partial code)
import mx.events.CloseEvent; import messages.MessageWindow public function undock():void {
    stage.nativeWindow.visible = true;
    stage.nativeWindow.orderToFront();
    //Clearing the bitmaps array also clears the applcation icon from the systray
    NativeApplication.nativeApplication .icon.bitmaps = [];
}
]]>
Package: (Partial code)
package messages { public class MessageWindow extends NativeWindow {
public function MessageWindow():void
{
 stage.addEventListener(MouseEvent.MOUSE_DOWN,onClick);
}
private function onClick(event:MouseEvent):void
{
    ****** Need to call the undock method from here. *****
}
}
}
Is it possible to call this way or suggest any other solution
Thanks in advance Senling.
© Stack Overflow or respective owner