I am creating a breeze app in Flex 4. I'm in need of a window in a chrome application.
What's in my main app creation?
Creating protected functions Edit Finish (event: FlexEvent): zero {facade.sendNotification (AppFacade.APP_INIT, this); Var Button: Navigator Window = New Navigator Window (); Var work support: workgroup = new workgroup (); Buttons.addElement (workgroup); Buttons.width = 115; Buttons.height = 200; Buttons.maximizable = false; Buttons.resizable = false; button. AddEventListener (EVENT. INDOWAWOMA, WNDOWComplete); Buttons.open (); } Private Events onWindowComplete (Event: AIREvent): Zero {event.currentTarget.x = 100; Event.currentTarget.y = 100; }
For some reason this app connects the window to the middle of the screen and if I set the window's X and Y, it does not place the location where I am in the upper left I hope my screen should keep the position of the window, where will I open this when I want to?
Thank you,
spark.command.window exists inside a native window If you want to move it around the screen then you will need to determine the status of the native window. It's a bit confusing because you can keep the window window as well as in place of the native window. You have to do the positioning after the creation is complete, otherwise you will get blank reference errors
You can use the window in this way if you have created a component based on spark.components. Window:
var win: MyWindow = new MyWindow (); // MXML component win.height = 150; Win.width = 300; Win.systemChrome = BasicWindows SystemCrum NON; Win.type = NativeWindow type. Lightweight; Win.showStatusBar = false; Win.transparent = true; Win.alwaysInFront = True; Win.open (true);
Then in that mxml component, you set a cache full event handler to:
var padding: int = 25; This.nativeWindow.x = Screen. ManScreen Visible. Right - this.width - padding; This.nativeWindow.y = Screen. Menscreen Visible. Off + padding;
This should keep your new window in the top right hand corner, with 25px padding on top and right.
Comments
Post a Comment